Spaces:
Sleeping
Sleeping
minor
Browse files- app.py +1 -1
- vis_st4rtrack.py +5 -4
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def check_ram_usage(threshold_percent=90):
|
|
| 28 |
def main() -> None:
|
| 29 |
# Load data once at startup using the function from vis_st4rtrack.py
|
| 30 |
global global_data_cache
|
| 31 |
-
global_data_cache = load_trajectory_data(use_float16=True, max_frames=
|
| 32 |
|
| 33 |
app = fastapi.FastAPI()
|
| 34 |
viser_manager = ViserProxyManager(app)
|
|
|
|
| 28 |
def main() -> None:
|
| 29 |
# Load data once at startup using the function from vis_st4rtrack.py
|
| 30 |
global global_data_cache
|
| 31 |
+
global_data_cache = load_trajectory_data(use_float16=True, max_frames=100, traj_path="480p_cows", mask_folder="cows")
|
| 32 |
|
| 33 |
app = fastapi.FastAPI()
|
| 34 |
viser_manager = ViserProxyManager(app)
|
vis_st4rtrack.py
CHANGED
|
@@ -163,16 +163,16 @@ def load_trajectory_data(traj_path="results", use_float16=True, max_frames=None,
|
|
| 163 |
def visualize_st4rtrack(
|
| 164 |
traj_path: str = "results",
|
| 165 |
up_dir: str = "-z", # should be +z or -z
|
| 166 |
-
max_frames: int =
|
| 167 |
share: bool = False,
|
| 168 |
-
point_size: float = 0.
|
| 169 |
downsample_factor: int = 3,
|
| 170 |
num_traj_points: int = 100,
|
| 171 |
conf_thre_percentile: float = 1,
|
| 172 |
traj_end_frame: int = 100,
|
| 173 |
traj_start_frame: int = 0,
|
| 174 |
traj_line_width: float = 3.,
|
| 175 |
-
fixed_length_traj: int =
|
| 176 |
server: viser.ViserServer = None,
|
| 177 |
use_float16: bool = True,
|
| 178 |
preloaded_data: dict = None, # Add this parameter to accept preloaded data
|
|
@@ -185,6 +185,7 @@ def visualize_st4rtrack(
|
|
| 185 |
mid_anchor: bool = False,
|
| 186 |
video_width: int = 320, # Video display width
|
| 187 |
video_height: int = 180, # Video display height
|
|
|
|
| 188 |
) -> None:
|
| 189 |
log_memory_usage("at start of visualization")
|
| 190 |
|
|
@@ -195,7 +196,7 @@ def visualize_st4rtrack(
|
|
| 195 |
|
| 196 |
@server.on_client_connect
|
| 197 |
def _(client: viser.ClientHandle) -> None:
|
| 198 |
-
client.camera.position =
|
| 199 |
client.camera.look_at = (0, 0, 0)
|
| 200 |
|
| 201 |
# Configure the GUI panel size and layout
|
|
|
|
| 163 |
def visualize_st4rtrack(
|
| 164 |
traj_path: str = "results",
|
| 165 |
up_dir: str = "-z", # should be +z or -z
|
| 166 |
+
max_frames: int = 100,
|
| 167 |
share: bool = False,
|
| 168 |
+
point_size: float = 0.005,
|
| 169 |
downsample_factor: int = 3,
|
| 170 |
num_traj_points: int = 100,
|
| 171 |
conf_thre_percentile: float = 1,
|
| 172 |
traj_end_frame: int = 100,
|
| 173 |
traj_start_frame: int = 0,
|
| 174 |
traj_line_width: float = 3.,
|
| 175 |
+
fixed_length_traj: int = 20,
|
| 176 |
server: viser.ViserServer = None,
|
| 177 |
use_float16: bool = True,
|
| 178 |
preloaded_data: dict = None, # Add this parameter to accept preloaded data
|
|
|
|
| 185 |
mid_anchor: bool = False,
|
| 186 |
video_width: int = 320, # Video display width
|
| 187 |
video_height: int = 180, # Video display height
|
| 188 |
+
camera_position: tuple[float, float, float] = (1e-3, 1.5, -0.2),
|
| 189 |
) -> None:
|
| 190 |
log_memory_usage("at start of visualization")
|
| 191 |
|
|
|
|
| 196 |
|
| 197 |
@server.on_client_connect
|
| 198 |
def _(client: viser.ClientHandle) -> None:
|
| 199 |
+
client.camera.position = camera_position
|
| 200 |
client.camera.look_at = (0, 0, 0)
|
| 201 |
|
| 202 |
# Configure the GUI panel size and layout
|