Spaces:
Sleeping
Sleeping
Mehmet Batuhan Duman
commited on
Commit
·
1c0fcfa
1
Parent(s):
e158920
Changed scan func
Browse files
app.py
CHANGED
@@ -242,10 +242,10 @@ def process_image(input_image, model, threshold=0.5):
|
|
242 |
def gradio_process_image(input_image, model, threshold=0.5):
|
243 |
start_time = time.time()
|
244 |
|
245 |
-
# save
|
246 |
temp = tempfile.NamedTemporaryFile(delete=False, suffix=".png")
|
247 |
temp.close()
|
248 |
-
|
249 |
|
250 |
# pass file path to scanmap
|
251 |
output_image_path = scanmap(temp.name, model, threshold)
|
|
|
242 |
def gradio_process_image(input_image, model, threshold=0.5):
|
243 |
start_time = time.time()
|
244 |
|
245 |
+
# save numpy array to a temporary file
|
246 |
temp = tempfile.NamedTemporaryFile(delete=False, suffix=".png")
|
247 |
temp.close()
|
248 |
+
cv2.imwrite(temp.name, cv2.cvtColor(input_image * 255, cv2.COLOR_RGB2BGR))
|
249 |
|
250 |
# pass file path to scanmap
|
251 |
output_image_path = scanmap(temp.name, model, threshold)
|