Spaces:
Sleeping
Sleeping
aryrk commited on
Commit ·
7d9b835
1
Parent(s): 26e1c44
[fix error]
Browse files25 unmodified lines2627282930313214 unmodified lines47484950515253545525 unmodified linesdef reflection_removal(input_image):if not input_image.lower().endswith((".jpg", ".jpeg", ".png")):return "File is not supported (only .jpg, .jpeg, .png)."file_path = os.path.join(UPLOAD_DIR, os.path.basename(input_image))shutil.copy(input_image, file_path)14 unmodified linesfor file in files:if file.endswith("_fake.png"):result_path = os.path.join(root, file)return Image.open(result_path)return "No results found."def use_sample_image(sample_image_name):sample_image_path = os.path.join(SAMPLE_DIR, sample_image_name)25 unmodified lines2627282930313214 unmodified lines4748495051525354555625 unmodified linesdef reflection_removal(input_image):if not input_image.lower().endswith((".jpg", ".jpeg", ".png")):return ["File is not supported (only .jpg, .jpeg, .png)."]file_path = os.path.join(UPLOAD_DIR, os.path.basename(input_image))shutil.copy(input_image, file_path)14 unmodified linesfor file in files:if file.endswith("_fake.png"):result_path = os.path.join(root, file)return [Image.open(result_path)]return ["No results found."]def use_sample_image(sample_image_name):sample_image_path = os.path.join(SAMPLE_DIR, sample_image_name)
app.py+4-3