Spaces:
Build error
Build error
File size: 558 Bytes
cd952f0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
from fastai.vision.all import *
import gradio as gr
import pathlib
plt = platform.system()
if plt == 'Linux':
pathlib.WindowsPath = pathlib.PosixPath
learn = load_learner('movie_score_regression_resnet18.pkl')
def predict(img):
img = PILImage.create(img)
pred, _, _= learn.predict(img)
return str(round(pred[0], 1))
gr.Interface(
fn=predict,
inputs=gr.inputs.Image(shape=(512, 512)),
outputs="text",
title= "Movie Poster Score Predictor",
interpretation='default',
enable_queue=True
).launch(inline=False) |