Created
February 24, 2022 16:37
-
-
Save kingabzpro/d900c00c7e0f6025bfee6cfc9ca0b945 to your computer and use it in GitHub Desktop.
Deploying Gradio App on Spaces Using DagsHub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import torch | |
import gradio as gr | |
from fastai.vision.all import * | |
data = create_data(Path("src/data/processed")) | |
learner = unet_learner( | |
data, resnet34, metrics=rmse, wd=1e-2, n_out=3, loss_func=MSELossFlat(), path="src/" | |
) | |
learner.load("model") | |
def gen(input_img): | |
return PILImageBW.create((learner.predict(input_img))[0]).convert("L") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment