Update app.py
Browse files
app.py
CHANGED
@@ -293,17 +293,18 @@ def extract(image):
|
|
293 |
#cv2.imwrite('/Users/vatsalya/Desktop/demo.jpeg',line_image)
|
294 |
|
295 |
|
296 |
-
im=Image.fromarray(line_image)
|
297 |
-
im=im.convert("L")
|
298 |
-
im.save("demo.jpeg")
|
299 |
-
print("#### Image Saved #######")
|
300 |
-
#('demo.png',line_image)
|
301 |
|
302 |
|
303 |
|
304 |
-
image = Image.open("demo.jpeg").convert("RGB")
|
305 |
-
#print("Started Processing")
|
306 |
|
|
|
|
|
307 |
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|
308 |
|
309 |
generated_ids = model.generate(pixel_values)
|
|
|
293 |
#cv2.imwrite('/Users/vatsalya/Desktop/demo.jpeg',line_image)
|
294 |
|
295 |
|
296 |
+
# im=Image.fromarray(line_image)
|
297 |
+
# im=im.convert("L")
|
298 |
+
# im.save("demo.jpeg")
|
299 |
+
# print("#### Image Saved #######")
|
300 |
+
#imageio.imwrite('demo.png',line_image)
|
301 |
|
302 |
|
303 |
|
304 |
+
#image = Image.open("demo.jpeg").convert("RGB")
|
|
|
305 |
|
306 |
+
#print("Started Processing")
|
307 |
+
image = line_image
|
308 |
pixel_values = processor(images=image, return_tensors="pt").pixel_values
|
309 |
|
310 |
generated_ids = model.generate(pixel_values)
|