Update app.py
Browse files
app.py
CHANGED
|
@@ -109,7 +109,7 @@ def run_prediction():
|
|
| 109 |
generation = model.generate(**batch, max_new_tokens=100)
|
| 110 |
decoded = processor.batch_decode(generation, skip_special_tokens=True)[0]
|
| 111 |
|
| 112 |
-
image = raw_image
|
| 113 |
width, height = image.size
|
| 114 |
|
| 115 |
result_image = visualize_bounding_boxes(image, decoded, width, height)
|
|
@@ -122,7 +122,7 @@ demo = gr.Interface(
|
|
| 122 |
inputs=[],
|
| 123 |
outputs=gr.Image(type="pil", label="Detected Bounding Box"),
|
| 124 |
title="Gemma3 Object Detector",
|
| 125 |
-
description="Click '
|
| 126 |
)
|
| 127 |
|
| 128 |
if __name__ == "__main__":
|
|
|
|
| 109 |
generation = model.generate(**batch, max_new_tokens=100)
|
| 110 |
decoded = processor.batch_decode(generation, skip_special_tokens=True)[0]
|
| 111 |
|
| 112 |
+
image = raw_image # ✅ FIXED: raw_image is already a PIL.Image
|
| 113 |
width, height = image.size
|
| 114 |
|
| 115 |
result_image = visualize_bounding_boxes(image, decoded, width, height)
|
|
|
|
| 122 |
inputs=[],
|
| 123 |
outputs=gr.Image(type="pil", label="Detected Bounding Box"),
|
| 124 |
title="Gemma3 Object Detector",
|
| 125 |
+
description="Click 'Submit' to visualize a prediction from a randomly sampled test image.",
|
| 126 |
)
|
| 127 |
|
| 128 |
if __name__ == "__main__":
|