ariG23498 HF Staff commited on
Commit
d53269f
·
verified ·
1 Parent(s): 2e1ee58

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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[0]
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 'Run' to visualize a prediction from a randomly sampled test image.",
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__":