Spaces:
Sleeping
Sleeping
Commit
·
7e1033f
1
Parent(s):
afb5083
Update app.py
Browse files
app.py
CHANGED
@@ -86,14 +86,14 @@ def update(user_choice, data_folder=VIDEO_PATH):
|
|
86 |
def replay(left, right):
|
87 |
return left, right
|
88 |
|
89 |
-
def parse_envs(folder=
|
90 |
envs = []
|
91 |
for f in os.listdir(folder):
|
92 |
if os.path.isdir(os.path.join(folder, f)):
|
93 |
envs.append(f)
|
94 |
return envs
|
95 |
|
96 |
-
def build_interface(iter=3, data_folder=
|
97 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
98 |
print(HF_TOKEN)
|
99 |
HF_TOKEN = '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' # my HF token
|
@@ -110,16 +110,16 @@ def build_interface(iter=3, data_folder='./videos'):
|
|
110 |
# some initial videos
|
111 |
if FORMAT == 'mp4':
|
112 |
left_video_path = os.path.join(os.path.dirname(__file__),
|
113 |
-
"
|
114 |
right_video_path = os.path.join(os.path.dirname(__file__),
|
115 |
-
"
|
116 |
left = gr.PlayableVideo(left_video_path, label="left_video")
|
117 |
right = gr.PlayableVideo(right_video_path, label="right_video")
|
118 |
else:
|
119 |
left_video_path = os.path.join(os.path.dirname(__file__),
|
120 |
-
"
|
121 |
right_video_path = os.path.join(os.path.dirname(__file__),
|
122 |
-
"
|
123 |
left = gr.Image(left_video_path, shape=(1024, 768), label="left_video")
|
124 |
# right = gr.Image(right_video_path).style(height=768, width=1024)
|
125 |
right = gr.Image(right_video_path, label="right_video")
|
|
|
86 |
def replay(left, right):
|
87 |
return left, right
|
88 |
|
89 |
+
def parse_envs(folder=VIDEO_PATH):
|
90 |
envs = []
|
91 |
for f in os.listdir(folder):
|
92 |
if os.path.isdir(os.path.join(folder, f)):
|
93 |
envs.append(f)
|
94 |
return envs
|
95 |
|
96 |
+
def build_interface(iter=3, data_folder=VIDEO_PATH):
|
97 |
HF_TOKEN = os.getenv('HF_TOKEN')
|
98 |
print(HF_TOKEN)
|
99 |
HF_TOKEN = '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' # my HF token
|
|
|
110 |
# some initial videos
|
111 |
if FORMAT == 'mp4':
|
112 |
left_video_path = os.path.join(os.path.dirname(__file__),
|
113 |
+
f"{VIDEO_PATH}/rl-video-episode-0.mp4")
|
114 |
right_video_path = os.path.join(os.path.dirname(__file__),
|
115 |
+
f"{VIDEO_PATH}/rl-video-episode-1.mp4")
|
116 |
left = gr.PlayableVideo(left_video_path, label="left_video")
|
117 |
right = gr.PlayableVideo(right_video_path, label="right_video")
|
118 |
else:
|
119 |
left_video_path = os.path.join(os.path.dirname(__file__),
|
120 |
+
f"{VIDEO_PATH}/rl-video-episode-0.gif")
|
121 |
right_video_path = os.path.join(os.path.dirname(__file__),
|
122 |
+
f"{VIDEO_PATH}/rl-video-episode-1.gif")
|
123 |
left = gr.Image(left_video_path, shape=(1024, 768), label="left_video")
|
124 |
# right = gr.Image(right_video_path).style(height=768, width=1024)
|
125 |
right = gr.Image(right_video_path, label="right_video")
|