xiaoyuxi commited on
Commit
3d4f5b5
·
1 Parent(s): 94f2349
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -100,10 +100,10 @@ def handle_video_upload(video):
100
  if BACKEND_AVAILABLE and backend_api and hasattr(backend_api, 'fns'):
101
  # Try to use backend API
102
  try:
103
- # Use the Blocks fns with numeric index (0 is usually the main function)
104
  if 0 in backend_api.fns:
105
  print("🔧 Calling backend function 0 (main processing function)")
106
- result = backend_api.fns[0](video, [], 50, 756, 3)
107
  # Parse the result to extract what we need
108
  if isinstance(result, dict) and result.get("success"):
109
  # For now, just extract the first frame locally
@@ -241,13 +241,11 @@ def launch_viz(grid_size, vo_points, fps, original_image_state):
241
  print(f"🔧 Original image state type: {type(original_image_state)}")
242
  print(f"🔧 Original image state preview: {str(original_image_state)[:100]}...")
243
 
244
- # Use the Blocks fns with numeric index (0 is usually the main function)
245
  if 0 in backend_api.fns:
246
  print("🔧 Calling backend function 0 (main processing function)")
247
  # For now, we'll use empty points since we're in local mode
248
- result = backend_api.fns[0](
249
- None, [], grid_size, vo_points, fps
250
- )
251
 
252
  print(f"✅ Backend API call successful!")
253
  print(f"🔧 Result type: {type(result)}")
 
100
  if BACKEND_AVAILABLE and backend_api and hasattr(backend_api, 'fns'):
101
  # Try to use backend API
102
  try:
103
+ # Use the Blocks predict method to call the function
104
  if 0 in backend_api.fns:
105
  print("🔧 Calling backend function 0 (main processing function)")
106
+ result = backend_api.predict(0, [video, [], 50, 756, 3])
107
  # Parse the result to extract what we need
108
  if isinstance(result, dict) and result.get("success"):
109
  # For now, just extract the first frame locally
 
241
  print(f"🔧 Original image state type: {type(original_image_state)}")
242
  print(f"🔧 Original image state preview: {str(original_image_state)[:100]}...")
243
 
244
+ # Use the Blocks predict method to call the function
245
  if 0 in backend_api.fns:
246
  print("🔧 Calling backend function 0 (main processing function)")
247
  # For now, we'll use empty points since we're in local mode
248
+ result = backend_api.predict(0, [None, [], grid_size, vo_points, fps])
 
 
249
 
250
  print(f"✅ Backend API call successful!")
251
  print(f"🔧 Result type: {type(result)}")