OmidSakaki commited on
Commit
b447319
·
verified ·
1 Parent(s): ced767e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -6
app.py CHANGED
@@ -133,13 +133,18 @@ if selected_type == "Upload Image":
133
  img_bytes = image.read()
134
 
135
  img = Image.open(io.BytesIO(img_bytes))
136
-
137
- #for img in results.imgs:
138
- # img_base64 = Image.fromarray(img)
139
- # img_base64.save(downloaded_image, format="JPEG")
140
 
141
- img = Image.fromarray(img)
142
- results = FINAL(img)
 
 
 
 
 
 
 
 
 
143
 
144
  final_image = Image.open(downloaded_image)
145
  print("Opening ",final_image)
 
133
  img_bytes = image.read()
134
 
135
  img = Image.open(io.BytesIO(img_bytes))
 
 
 
 
136
 
137
+
138
+ img = np.asarray(bytearray(img.read()), dtype=np.uint8)
139
+
140
+ img = cv2.imdecode(img, cv2.IMREAD_COLOR)
141
+
142
+ results = FINAL(img)
143
+
144
+ for img in results.imgs:
145
+ img_base64 = Image.fromarray(img)
146
+ img_base64.save(downloaded_image, format="JPEG")
147
+
148
 
149
  final_image = Image.open(downloaded_image)
150
  print("Opening ",final_image)