Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -65,8 +65,6 @@ def run_florence_model(image_np, image_size, task_prompt, text_input=None):
|
|
| 65 |
# Function to plot image with bounding boxes
|
| 66 |
def plot_image_with_bboxes(image_np, bboxes, labels=None):
|
| 67 |
fig, ax = plt.subplots(1)
|
| 68 |
-
# Normalize the image data to the range [0, 1]
|
| 69 |
-
image_np = image_np / 255.0
|
| 70 |
ax.imshow(image_np)
|
| 71 |
colors = ['red', 'blue', 'green', 'yellow', 'purple', 'cyan']
|
| 72 |
for i, bbox in enumerate(bboxes):
|
|
@@ -83,7 +81,7 @@ def plot_image_with_bboxes(image_np, bboxes, labels=None):
|
|
| 83 |
@spaces.GPU
|
| 84 |
def process_image(image_path):
|
| 85 |
image_np, image_size = preprocess_image(image_path)
|
| 86 |
-
|
| 87 |
# Convert image_np to float32
|
| 88 |
image_np = image_np.astype(np.float32)
|
| 89 |
|
|
@@ -161,4 +159,4 @@ with gr.Blocks(theme='NoCrypt/miku') as demo:
|
|
| 161 |
"""
|
| 162 |
gr.HTML(footer)
|
| 163 |
|
| 164 |
-
demo.launch()
|
|
|
|
| 65 |
# Function to plot image with bounding boxes
|
| 66 |
def plot_image_with_bboxes(image_np, bboxes, labels=None):
|
| 67 |
fig, ax = plt.subplots(1)
|
|
|
|
|
|
|
| 68 |
ax.imshow(image_np)
|
| 69 |
colors = ['red', 'blue', 'green', 'yellow', 'purple', 'cyan']
|
| 70 |
for i, bbox in enumerate(bboxes):
|
|
|
|
| 81 |
@spaces.GPU
|
| 82 |
def process_image(image_path):
|
| 83 |
image_np, image_size = preprocess_image(image_path)
|
| 84 |
+
|
| 85 |
# Convert image_np to float32
|
| 86 |
image_np = image_np.astype(np.float32)
|
| 87 |
|
|
|
|
| 159 |
"""
|
| 160 |
gr.HTML(footer)
|
| 161 |
|
| 162 |
+
demo.launch()
|