freealise commited on
Commit
df7ff25
1 Parent(s): 078b694

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -533,8 +533,9 @@ with gr.Blocks(css=css) as demo:
533
  render = gr.Button("Render")
534
 
535
  def on_submit(uploaded_video,model_type,coordinates):
536
-
537
  global locations
 
 
538
  if not coordinates:
539
  locations_str = example_coords.split()
540
  else:
@@ -549,8 +550,8 @@ with gr.Blocks(css=css) as demo:
549
  avg_coords[0] = avg_coords[0] / len(locations_str)
550
  avg_coords[1] = avg_coords[1] / len(locations_str)
551
 
552
- for k, location in enumerate(locations_str):
553
- locations[k] = [ float(location[0]) - avg_coords[0], float(location[1]) - avg_coords[1] ]
554
  print(locations)
555
 
556
  # Process the video and get the path of the output video
 
533
  render = gr.Button("Render")
534
 
535
  def on_submit(uploaded_video,model_type,coordinates):
 
536
  global locations
537
+ locations = []
538
+
539
  if not coordinates:
540
  locations_str = example_coords.split()
541
  else:
 
550
  avg_coords[0] = avg_coords[0] / len(locations_str)
551
  avg_coords[1] = avg_coords[1] / len(locations_str)
552
 
553
+ for location in locations_str:
554
+ locations.append([ float(location[0]) - avg_coords[0], float(location[1]) - avg_coords[1] ])
555
  print(locations)
556
 
557
  # Process the video and get the path of the output video