Upload folder using huggingface_hub
Browse files
main.py
CHANGED
|
@@ -73,15 +73,16 @@ class TransNetV2Torch:
|
|
| 73 |
|
| 74 |
predictions = []
|
| 75 |
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
min(len(predictions) * 50, total)
|
| 83 |
-
|
| 84 |
-
|
|
|
|
| 85 |
|
| 86 |
single_frame_pred = np.concatenate([single_ for single_, _ in predictions])
|
| 87 |
all_frames_pred = np.concatenate([all_ for _, all_ in predictions])
|
|
|
|
| 73 |
|
| 74 |
predictions = []
|
| 75 |
|
| 76 |
+
with tqdm(total=total, desc="[TransNetV2] Processing video frames", unit="frames") as pbar:
|
| 77 |
+
for inp in input_iterator():
|
| 78 |
+
single_frame_pred, all_frames_pred = self.predict_raw(inp)
|
| 79 |
+
predictions.append((single_frame_pred[0, 25:75, 0],
|
| 80 |
+
all_frames_pred[0, 25:75, 0]))
|
| 81 |
+
|
| 82 |
+
processed = min(len(predictions) * 50, total)
|
| 83 |
+
pbar.n = processed
|
| 84 |
+
pbar.last_print_n = processed
|
| 85 |
+
pbar.refresh()
|
| 86 |
|
| 87 |
single_frame_pred = np.concatenate([single_ for single_, _ in predictions])
|
| 88 |
all_frames_pred = np.concatenate([all_ for _, all_ in predictions])
|