Spaces:
Sleeping
Sleeping
Mehmet Batuhan Duman
commited on
Commit
·
de18bbd
1
Parent(s):
1f00d4e
Changes
Browse files
app.py
CHANGED
@@ -85,7 +85,7 @@ else:
|
|
85 |
|
86 |
|
87 |
def process_image(input_image):
|
88 |
-
image = Image.
|
89 |
|
90 |
start_time = time.time()
|
91 |
heatmap = scanmap(np.array(image), model)
|
@@ -96,6 +96,7 @@ def process_image(input_image):
|
|
96 |
|
97 |
return image, heatmap_img, int(elapsed_time)
|
98 |
|
|
|
99 |
def scanmap(image_np, model):
|
100 |
image_np = image_np.astype(np.float32) / 255.0
|
101 |
|
@@ -123,7 +124,7 @@ def scanmap(image_np, model):
|
|
123 |
return probabilities_map
|
124 |
|
125 |
def gradio_process_image(input_image):
|
126 |
-
original, heatmap, elapsed_time = process_image(input_image
|
127 |
return original, heatmap, f"Elapsed Time (seconds): {elapsed_time}"
|
128 |
|
129 |
inputs = gr.Image(label="Upload Image")
|
|
|
85 |
|
86 |
|
87 |
def process_image(input_image):
|
88 |
+
image = Image.fromarray(input_image).convert("RGB")
|
89 |
|
90 |
start_time = time.time()
|
91 |
heatmap = scanmap(np.array(image), model)
|
|
|
96 |
|
97 |
return image, heatmap_img, int(elapsed_time)
|
98 |
|
99 |
+
|
100 |
def scanmap(image_np, model):
|
101 |
image_np = image_np.astype(np.float32) / 255.0
|
102 |
|
|
|
124 |
return probabilities_map
|
125 |
|
126 |
def gradio_process_image(input_image):
|
127 |
+
original, heatmap, elapsed_time = process_image(input_image)
|
128 |
return original, heatmap, f"Elapsed Time (seconds): {elapsed_time}"
|
129 |
|
130 |
inputs = gr.Image(label="Upload Image")
|