FrezzyI's picture
Update app.py
c2fd87e verified
raw
history blame contribute delete
502 Bytes
from mmdet.apis import init_detector, inference_detector
import mmcv
import gradio as gr
config_file = 'config/fashionformer_fashionpedia.py'
checkpoint_file = 'checkpoints/fashionformer.pth'
model = init_detector(config_file, checkpoint_file, device='cpu')
def predict(img):
result = inference_detector(model, img)
model.show_result(img, result, out_file='result.jpg', show=False)
return 'result.jpg'
gr.Interface(fn=predict, inputs=gr.Image(type="filepath"), outputs="image").launch()