Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ from object_detection.utils import ops as utils_op
|
|
10 |
import gradio as gr
|
11 |
# from huggingface_hub import snapshot_download
|
12 |
import os
|
13 |
-
from tqdm import tqdm
|
14 |
import cv2
|
15 |
|
16 |
|
@@ -68,23 +67,6 @@ def predict_on_video(video_in_filepath, video_out_filepath, detection_model, cat
|
|
68 |
processed_frame = predict(frame)
|
69 |
processed_frame_np = np.array(processed_frame)
|
70 |
video_writer.write(processed_frame_np)
|
71 |
-
# for i in tqdm(range(nb_frames)):
|
72 |
-
# ret, image_np = video_reader.read()
|
73 |
-
# input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.uint8)
|
74 |
-
# results = detection_model(input_tensor)
|
75 |
-
# viz_utils.visualize_boxes_and_labels_on_image_array(
|
76 |
-
# image_np,
|
77 |
-
# results['detection_boxes'][0].numpy(),
|
78 |
-
# (results['detection_classes'][0].numpy()+ label_id_offset).astype(int),
|
79 |
-
# results['detection_scores'][0].numpy(),
|
80 |
-
# category_index,
|
81 |
-
# use_normalized_coordinates=True,
|
82 |
-
# max_boxes_to_draw=200,
|
83 |
-
# min_score_thresh=.50,
|
84 |
-
# agnostic_mode=False,
|
85 |
-
# line_thickness=2)
|
86 |
-
|
87 |
-
# video_writer.write(np.uint8(image_np))
|
88 |
|
89 |
# Release camera and close windows
|
90 |
video_reader.release()
|
|
|
10 |
import gradio as gr
|
11 |
# from huggingface_hub import snapshot_download
|
12 |
import os
|
|
|
13 |
import cv2
|
14 |
|
15 |
|
|
|
67 |
processed_frame = predict(frame)
|
68 |
processed_frame_np = np.array(processed_frame)
|
69 |
video_writer.write(processed_frame_np)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
71 |
# Release camera and close windows
|
72 |
video_reader.release()
|