sezer-muhammed commited on
Commit
8dbd3b3
·
1 Parent(s): 4011c92
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -211,10 +211,10 @@ def generate_annotated_image(results, original_image: Image.Image) -> Image.Imag
211
  #annotated_rgb = cv2.cvtColor(annotated_array, cv2.COLOR_BGR2RGB)
212
 
213
  # Ensure the array is in the correct data type
214
- annotated_rgb = annotated_rgb.astype(np.uint8)
215
 
216
  # Convert NumPy array back to PIL Image
217
- annotated_image = Image.fromarray(annotated_rgb)
218
 
219
  # Verify the conversion worked
220
  logger.info("Generated annotated image successfully with dimensions: %s, mode: %s",
@@ -302,7 +302,7 @@ def create_gradio_interface():
302
  outputs=[
303
  gr.Image(
304
  type="pil",
305
- label="Annotated Image with Detections (RGB Fixed)",
306
  height=400,
307
  show_label=True
308
  ),
 
211
  #annotated_rgb = cv2.cvtColor(annotated_array, cv2.COLOR_BGR2RGB)
212
 
213
  # Ensure the array is in the correct data type
214
+ annotated_array = annotated_array.astype(np.uint8)
215
 
216
  # Convert NumPy array back to PIL Image
217
+ annotated_image = Image.fromarray(annotated_array)
218
 
219
  # Verify the conversion worked
220
  logger.info("Generated annotated image successfully with dimensions: %s, mode: %s",
 
302
  outputs=[
303
  gr.Image(
304
  type="pil",
305
+ label="Annotated Image with Detections",
306
  height=400,
307
  show_label=True
308
  ),