merve HF staff commited on
Commit
4a7e314
1 Parent(s): 3db7352

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -41,6 +41,8 @@ def annotate_image(
41
  output_image = LABEL_ANNOTATOR.annotate(output_image, detections, labels=labels)
42
  return output_image
43
 
 
 
44
  def process_video(
45
  input_video,
46
  progress=gr.Progress(track_tqdm=True)
@@ -72,7 +74,8 @@ def process_video(
72
  )
73
  sink.write_frame(frame)
74
  return result_file_path
75
- @spaces.GPU
 
76
  def query(image):
77
  inputs = processor(images=image, return_tensors="pt").to(device)
78
  with torch.no_grad():
@@ -111,4 +114,4 @@ with gr.Blocks() as demo:
111
  outputs=output_video
112
  )
113
 
114
- demo.launch(debug=True, show_error=True)
 
41
  output_image = LABEL_ANNOTATOR.annotate(output_image, detections, labels=labels)
42
  return output_image
43
 
44
+
45
+ @spaces.GPU
46
  def process_video(
47
  input_video,
48
  progress=gr.Progress(track_tqdm=True)
 
74
  )
75
  sink.write_frame(frame)
76
  return result_file_path
77
+
78
+
79
  def query(image):
80
  inputs = processor(images=image, return_tensors="pt").to(device)
81
  with torch.no_grad():
 
114
  outputs=output_video
115
  )
116
 
117
+ demo.launch(show_error=True)