Parthebhan commited on
Commit
ae3d5be
·
verified ·
1 Parent(s): b1ee06c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -4,7 +4,7 @@ import torch
4
  from PIL import Image
5
 
6
  # Load the model
7
- model = AutoModelForImageSegmentation.from_pretrained("path/to/gelan-c-seg.pt")
8
 
9
  # Load the tokenizer (if needed)
10
  tokenizer = AutoTokenizer.from_pretrained("path/to/tokenizer")
@@ -16,7 +16,7 @@ def predict_segmentation(image):
16
  # Perform inference
17
  output = model(image)
18
  # Process the output as needed (e.g., post-processing for segmentation masks)
19
- # (Replace this with your actual processing code)
20
  segmentation_mask = output.logits.argmax(dim=1).squeeze().detach().numpy()
21
  return segmentation_mask
22
 
 
4
  from PIL import Image
5
 
6
  # Load the model
7
+ model = AutoModelForImageSegmentation.from_pretrained("./gelan-c-seg.pt")
8
 
9
  # Load the tokenizer (if needed)
10
  tokenizer = AutoTokenizer.from_pretrained("path/to/tokenizer")
 
16
  # Perform inference
17
  output = model(image)
18
  # Process the output as needed (e.g., post-processing for segmentation masks)
19
+
20
  segmentation_mask = output.logits.argmax(dim=1).squeeze().detach().numpy()
21
  return segmentation_mask
22