hysts HF staff commited on
Commit
0e7235b
1 Parent(s): de8155f

Add error handling

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -498,7 +498,8 @@ def delete_last_drag(tracking_points, first_frame_path, drag_mode):
498
  color = (255, 0, 0, 255)
499
  elif drag_mode == "camera":
500
  color = (0, 0, 255, 255)
501
- tracking_points.pop()
 
502
  transparent_background = Image.open(first_frame_path).convert("RGBA")
503
  w, h = transparent_background.size
504
  transparent_layer = np.zeros((h, w, 4))
 
498
  color = (255, 0, 0, 255)
499
  elif drag_mode == "camera":
500
  color = (0, 0, 255, 255)
501
+ if tracking_points:
502
+ tracking_points.pop()
503
  transparent_background = Image.open(first_frame_path).convert("RGBA")
504
  w, h = transparent_background.size
505
  transparent_layer = np.zeros((h, w, 4))