Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -53,6 +53,13 @@ classes = {4: ('nv', ' melanocytic nevi'), 6: ('mel', 'melanoma'),
|
|
53 |
|
54 |
|
55 |
if file is not None:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
img = cv2.imread(file)
|
57 |
# cv2_imshow(img)
|
58 |
img1 = cv2.resize(img, (28, 28))
|
|
|
53 |
|
54 |
|
55 |
if file is not None:
|
56 |
+
temp_dir = tempfile.TemporaryDirectory()
|
57 |
+
temp_file_path = temp_dir.name + "/" + file.name
|
58 |
+
|
59 |
+
# Save the uploaded file to the temporary directory
|
60 |
+
with open(temp_file_path, "wb") as f:
|
61 |
+
f.write(file.read())
|
62 |
+
|
63 |
img = cv2.imread(file)
|
64 |
# cv2_imshow(img)
|
65 |
img1 = cv2.resize(img, (28, 28))
|