Update demo.py
Browse files
demo.py
CHANGED
|
@@ -155,7 +155,7 @@ def main():
|
|
| 155 |
top_predictions = [(LABEL_LIST[i], float(score)) for i, score in zip(topk_indices, topk_scores)]
|
| 156 |
|
| 157 |
image_name = os.path.basename(image_path)
|
| 158 |
-
output_str = f"\nTop 3 Predictions:\n"
|
| 159 |
for rank, (lbl, score) in enumerate(top_predictions, start=1):
|
| 160 |
output_str += f"Rank {rank}: {lbl} ({score:.4f})\t\t\t"
|
| 161 |
print(f"Selected image: {image_name}")
|
|
|
|
| 155 |
top_predictions = [(LABEL_LIST[i], float(score)) for i, score in zip(topk_indices, topk_scores)]
|
| 156 |
|
| 157 |
image_name = os.path.basename(image_path)
|
| 158 |
+
output_str = f"Frame: {image_name.split(".")[0]}\n\nTop 3 Predictions:\n"
|
| 159 |
for rank, (lbl, score) in enumerate(top_predictions, start=1):
|
| 160 |
output_str += f"Rank {rank}: {lbl} ({score:.4f})\t\t\t"
|
| 161 |
print(f"Selected image: {image_name}")
|