kristinazk commited on
Commit
03e0bc9
·
verified ·
1 Parent(s): d7f2276

Update app.py

Browse files

debug stage 1: add print statements

Files changed (1) hide show
  1. app.py +4 -0
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: