Spaces:
Sleeping
Sleeping
Update app.py
Browse filesdebug stage 1: add print statements
app.py
CHANGED
|
@@ -22,11 +22,15 @@ async def root():
|
|
| 22 |
async def enhance_img(file: UploadFile = File(...)):
|
| 23 |
try:
|
| 24 |
data = await file.read()
|
|
|
|
| 25 |
img = Image.open(io.BytesIO(data)).convert("RGB")
|
|
|
|
| 26 |
sr = model.predict(img)
|
|
|
|
| 27 |
buf = io.BytesIO()
|
| 28 |
sr.save(buf, format="PNG")
|
| 29 |
buf.seek(0)
|
|
|
|
| 30 |
return StreamingResponse(buf, media_type="image/png")
|
| 31 |
|
| 32 |
except Exception as e:
|
|
|
|
| 22 |
async def enhance_img(file: UploadFile = File(...)):
|
| 23 |
try:
|
| 24 |
data = await file.read()
|
| 25 |
+
print('File read')
|
| 26 |
img = Image.open(io.BytesIO(data)).convert("RGB")
|
| 27 |
+
print('Passing file into network')
|
| 28 |
sr = model.predict(img)
|
| 29 |
+
print("File output")
|
| 30 |
buf = io.BytesIO()
|
| 31 |
sr.save(buf, format="PNG")
|
| 32 |
buf.seek(0)
|
| 33 |
+
print('Done')
|
| 34 |
return StreamingResponse(buf, media_type="image/png")
|
| 35 |
|
| 36 |
except Exception as e:
|