Skip to content

Commit

Permalink
Changed to 4x upscaling, added gaussian noise layer, removed backbone
Browse files Browse the repository at this point in the history
  • Loading branch information
birdstream committed Sep 19, 2021
1 parent 38189e2 commit 90c0eed
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 210 deletions.
8 changes: 5 additions & 3 deletions inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io
from fastapi import FastAPI, Response, File
from fastapi.staticfiles import StaticFiles
import webbrowser

app = FastAPI()

Expand All @@ -26,9 +27,9 @@ async def predict(bild: bytes = File(...)):
img = Image.open(io.BytesIO(bild)).convert("RGB")
W, H = img.size

# Double the size of the image (it's because the way this model was trained)
W = W * 2
H = H * 2
# Upsample imgage 4x (it's because the way this model was trained)
W = W * 4
H = H * 4
img = img.resize((W, H))

# Since the model only takes the image in blocks of 208x208, we need to pad the image to be evenly divideable with this size
Expand Down Expand Up @@ -73,3 +74,4 @@ async def predict(bild: bytes = File(...)):

app.mount("/", StaticFiles(directory="form"), name="form")

webbrowser.open("http://localhost:8000/form.html")
Loading

0 comments on commit 90c0eed

Please sign in to comment.