Spaces:
Runtime error
Runtime error
Custom Camera Poses to CAMERA_MOTION_MODE[2]
Browse files- app.py +3 -3
- gradio_utils/camera_utils.py +1 -1
app.py
CHANGED
@@ -221,7 +221,7 @@ def display_camera_info(camera_dict, camera_mode=None):
|
|
221 |
res = ""
|
222 |
res += f"motion : {[_ for _ in camera_dict['motion']]}. "
|
223 |
res += f"speed : {camera_dict['speed']}. "
|
224 |
-
if camera_mode ==
|
225 |
res += f"mode : {camera_dict['mode']}. "
|
226 |
return res
|
227 |
|
@@ -241,7 +241,7 @@ def add_camera_motion(camera_motion, camera_mode):
|
|
241 |
global camera_dict
|
242 |
if camera_dict['complex'] is not None:
|
243 |
camera_dict['complex'] = None
|
244 |
-
if camera_mode ==
|
245 |
camera_dict['motion'].append(camera_motion)
|
246 |
else:
|
247 |
camera_dict['motion']=[camera_motion]
|
@@ -833,7 +833,7 @@ def main(args):
|
|
833 |
show_label=False, visible=False)
|
834 |
|
835 |
# step2.3 - camera motion control - custom
|
836 |
-
custom_camera_motion = gr.Markdown("---\n###
|
837 |
custom_run_status = gr.Markdown(f"\n 1. Click two of the basic camera poses, such as `Pan Up` and `Pan Left`; \
|
838 |
\n 2. Click `Customized Mode 1: First A then B` or `Customized Mode 1: First A then B` \
|
839 |
\n - `Customized Mode 1: First A then B`: The camera first `Pan Up` and then `Pan Left`; \
|
|
|
221 |
res = ""
|
222 |
res += f"motion : {[_ for _ in camera_dict['motion']]}. "
|
223 |
res += f"speed : {camera_dict['speed']}. "
|
224 |
+
if camera_mode == CAMERA_MOTION_MODE[2]:
|
225 |
res += f"mode : {camera_dict['mode']}. "
|
226 |
return res
|
227 |
|
|
|
241 |
global camera_dict
|
242 |
if camera_dict['complex'] is not None:
|
243 |
camera_dict['complex'] = None
|
244 |
+
if camera_mode == CAMERA_MOTION_MODE[2] and len(camera_dict['motion']) <2:
|
245 |
camera_dict['motion'].append(camera_motion)
|
246 |
else:
|
247 |
camera_dict['motion']=[camera_motion]
|
|
|
833 |
show_label=False, visible=False)
|
834 |
|
835 |
# step2.3 - camera motion control - custom
|
836 |
+
custom_camera_motion = gr.Markdown(f"---\n### {CAMERA_MOTION_MODE[2]}", show_label=False, visible=False)
|
837 |
custom_run_status = gr.Markdown(f"\n 1. Click two of the basic camera poses, such as `Pan Up` and `Pan Left`; \
|
838 |
\n 2. Click `Customized Mode 1: First A then B` or `Customized Mode 1: First A then B` \
|
839 |
\n - `Customized Mode 1: First A then B`: The camera first `Pan Up` and then `Pan Left`; \
|
gradio_utils/camera_utils.py
CHANGED
@@ -5,7 +5,7 @@ import json
|
|
5 |
|
6 |
import numpy as np
|
7 |
|
8 |
-
CAMERA_MOTION_MODE = ["Basic Camera Poses", "Provided Complex Camera Poses", "
|
9 |
|
10 |
CAMERA = {
|
11 |
# T
|
|
|
5 |
|
6 |
import numpy as np
|
7 |
|
8 |
+
CAMERA_MOTION_MODE = ["Basic Camera Poses", "Provided Complex Camera Poses", "Custom Camera Poses"]
|
9 |
|
10 |
CAMERA = {
|
11 |
# T
|