Spaces:
Runtime error
Runtime error
Update app.py
Browse files3 unmodified lines4567789105 unmodified lines16171819192021223 unmodified linesfrom PIL import Image
# Load the modelmodel = AutoModelForImageSegmentation.from_pretrained("path/to/gelan-c-seg.pt")model = AutoModelForImageSegmentation.from_pretrained("./gelan-c-seg.pt")
# Load the tokenizer (if needed)tokenizer = AutoTokenizer.from_pretrained("path/to/tokenizer")5 unmodified lines # Perform inference output = 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_mask
app.py+2-2