Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,6 +35,14 @@ def image_analyzer(image: UploadFile = File(...)):
|
|
35 |
top k materials similar to the wall, ceiling, and floor.
|
36 |
"""
|
37 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
# load image
|
39 |
image_path = os.path.join(input_images_dir, "image.png")
|
40 |
with open(image_path, "wb") as buffer:
|
|
|
35 |
top k materials similar to the wall, ceiling, and floor.
|
36 |
"""
|
37 |
try:
|
38 |
+
# delete contents of image folder
|
39 |
+
for filename in os.listdir(temp_processing_dir):
|
40 |
+
file_path = os.path.join(temp_processing_dir, filename)
|
41 |
+
try:
|
42 |
+
os.remove(file_path) # Remove the file
|
43 |
+
except Exception as e:
|
44 |
+
print(f"Failed to delete {file_path}. Reason: {e}")
|
45 |
+
|
46 |
# load image
|
47 |
image_path = os.path.join(input_images_dir, "image.png")
|
48 |
with open(image_path, "wb") as buffer:
|