Spaces:
Runtime error
Runtime error
ailab commited on
Commit ·
a412dbf
1
Parent(s): 8f2aa2e
segmentation
Browse files5 unmodified lines678910111290 unmodified lines1031041051061071081091101111121131141151165 unmodified linesimport torchfrom transformers import AutoImageProcessor, AutoModelForSemanticSegmentation# ✅ PyTorch 모델로 변경MODEL_ID = "nvidia/segformer-b5-finetuned-ade-640-640"processor = AutoImageProcessor.from_pretrained(MODEL_ID)model = AutoModelForSemanticSegmentation.from_pretrained(MODEL_ID)90 unmodified linesdemo = gr.Interface(fn=run_inference,inputs=gr.Image(type="numpy", label="Input Image"),outputs=["plot"],examples=["ADE_val_00000001.jpeg","ADE_val_00001159.jpg","ADE_val_00001248.jpg","ADE_val_00001472.jpg"],allow_flagging="never",)if __name__ == "__main__":5 unmodified lines6789101190 unmodified lines1021031041051061071081091101111121131141151165 unmodified linesimport torchfrom transformers import AutoImageProcessor, AutoModelForSemanticSegmentationMODEL_ID = "nvidia/segformer-b5-finetuned-ade-640-640"processor = AutoImageProcessor.from_pretrained(MODEL_ID)model = AutoModelForSemanticSegmentation.from_pretrained(MODEL_ID)90 unmodified linesdemo = gr.Interface(fn=run_inference,inputs=gr.Image(type="numpy", label="Input Image"),outputs=gr.Plot(label="Overlay + Legend"),examples=["ADE_val_00000001.jpeg","ADE_val_00001159.jpg","ADE_val_00001248.jpg","ADE_val_00001472.jpg"],flagging_mode="never",cache_examples=False,)if __name__ == "__main__":
app.py+3-3