Spaces:
Runtime error
Runtime error
Update app.py
Browse files3 unmodified lines456789105 unmodified lines161718192021223 unmodified linesfrom PIL import Image# Load the modelmodel = AutoModelForImageSegmentation.from_pretrained("path/to/gelan-c-seg.pt")# Load the tokenizer (if needed)tokenizer = AutoTokenizer.from_pretrained("path/to/tokenizer")5 unmodified lines# Perform inferenceoutput = model(image)# Process the output as needed (e.g., post-processing for segmentation masks)# (Replace this with your actual processing code)segmentation_mask = output.logits.argmax(dim=1).squeeze().detach().numpy()return segmentation_mask3 unmodified lines456789105 unmodified lines161718192021223 unmodified linesfrom PIL import Image# Load the modelmodel = AutoModelForImageSegmentation.from_pretrained("./gelan-c-seg.pt")# Load the tokenizer (if needed)tokenizer = AutoTokenizer.from_pretrained("path/to/tokenizer")5 unmodified lines# Perform inferenceoutput = model(image)# Process the output as needed (e.g., post-processing for segmentation masks)segmentation_mask = output.logits.argmax(dim=1).squeeze().detach().numpy()return segmentation_mask
app.py+2-2