Spaces:
Sleeping
Sleeping
Commit
·
30ecb32
1
Parent(s):
5e61ae1
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,10 +17,10 @@ image_processor = AutoImageProcessor.from_pretrained(
|
|
| 17 |
@app.route('/upload_image', methods=['POST'])
|
| 18 |
def upload_image():
|
| 19 |
# Get the image file from the request
|
| 20 |
-
image_file = request.files['image']
|
| 21 |
|
| 22 |
# image = Image.open(BytesIO(image_file.read()))
|
| 23 |
-
image = Image.open(image_file
|
| 24 |
inputs = image_processor(image, return_tensors="pt")
|
| 25 |
|
| 26 |
with torch.no_grad():
|
|
|
|
| 17 |
@app.route('/upload_image', methods=['POST'])
|
| 18 |
def upload_image():
|
| 19 |
# Get the image file from the request
|
| 20 |
+
image_file = request.files['image'].stream
|
| 21 |
|
| 22 |
# image = Image.open(BytesIO(image_file.read()))
|
| 23 |
+
image = Image.open(image_file)
|
| 24 |
inputs = image_processor(image, return_tensors="pt")
|
| 25 |
|
| 26 |
with torch.no_grad():
|