-
Notifications
You must be signed in to change notification settings - Fork 71
/
load_env.py
executable file
·68 lines (63 loc) · 3.85 KB
/
load_env.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import os
import argparse
import wget
import zipfile
import sys
import shutil
binary_linux = dict(
# for searching
RealisticRoom='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/RealisticRendering_RL_3.10.zip',
Arch1='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/ArchinteriorsVol2Scene1-Linux-0.3.10.zip',
# env with spline target for tracking
SplineCharacterA='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/SplineCharacterA.zip', # env for end-to-end active object tracking (icml 2018, tpami)
SplineCharacterF='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/SplineCharacterF.zip', # env for end-to-end active object tracking (icml 2018, tpami)
# training env for tracking
RandomRoom='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/RandomRoom.zip', # env for end-to-end active object tracking (icml 2018, tpami)
DuelingRoom='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/DuelingRoom.zip', # env for ad-vat (iclr 2019)
FlexibleRoom='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/FlexibleRoom.zip', # env with distractors and obstacles (icml 2021)
MCRoom='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/MCRoom.zip', # env for pose-assisted multi-camera tracking (aaai 2020)
Textures='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/Textures.zip', # textures for environment augmentation
# realistic testing env for tracking
UrbanCity='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/UrbanCity_2P.zip', # env for ad-vat (iclr 2019)
SnowForest='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/SnowForest_2P.zip', # env for ad-vat (iclr 2019)
Garage='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/Garage_2P.zip', # env for ad-vat (iclr 2019)
UrbanCityMulti='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/UrbanCity_Multi.zip', # env for distraction robustness (icml 2021)
GarageMulti='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/ParkingLot_Multi.zip', # env for distraction robustness (icml 2021)
# multi camera
UrbanTree='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/urban_cam.zip', # env for pose-assisted multi-camera tracking (aaai 2020)
Garden='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/neighborhood.zip', # env for pose-assisted multi-camera tracking (aaai 2020)
# Arm env
Arm='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/arm-0610.zip',
test='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/testfolder.zip' # this is an empty file used for testing the script
)
binary_win = dict(
FlexibleRoom='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/FlexibleRoom_Win_v0.zip',
UrbanCity='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/urbancity_win_v1.zip',
Garage='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/parkinglot_win_v1.zip',
Garden='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/neighborhood_win_v1.zip',
test='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/testfolder.zip',
Textures='https://gym-unrealcv.oss-cn-beijing.aliyuncs.com/Textures.zip'
)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=None)
parser.add_argument("-e", "--env", nargs='?', default='Textures',
help='Select the binary to download')
if 'win' in sys.platform:
binary_all = binary_win
elif 'linux' in sys.platform:
binary_all = binary_linux
args = parser.parse_args()
if args.env in binary_all:
filename = wget.download(binary_all[args.env]) # download the binary
with zipfile.ZipFile(filename, "r") as z:
z.extractall() # extract the zip file
if 'Textures' in filename:
folder ='textures'
else:
folder = filename[:-4]
target = 'gym_unrealcv/envs/UnrealEnv'
shutil.move(folder, target)
os.remove(filename)
else:
print(f"{args.env} is not available to your platform")
exit()