aryrk commited on
Commit
a86af59
·
1 Parent(s): 0b76722

[fix] attemp to convert image before processing

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -21,7 +21,10 @@ model_path = hf_hub_download(repo_id=REPO_ID, filename=MODEL_FILE, cache_dir=CHE
21
  def reflection_removal(input_images):
22
  for input_image in input_images:
23
  file_path = os.path.join(UPLOAD_DIR, input_image.name)
24
- input_image.save(file_path)
 
 
 
25
 
26
  cmd = [
27
  "python", "test.py",
 
21
  def reflection_removal(input_images):
22
  for input_image in input_images:
23
  file_path = os.path.join(UPLOAD_DIR, input_image.name)
24
+
25
+ with open(input_image.name, "rb") as f:
26
+ image = Image.open(f)
27
+ image.save(file_path)
28
 
29
  cmd = [
30
  "python", "test.py",