pamixsun commited on
Commit
e1698e9
1 Parent(s): 2800753

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +2 -1
README.md CHANGED
@@ -55,6 +55,7 @@ import cv2
55
  import torch
56
  import numpy as np
57
 
 
58
  from transformers import AutoImageProcessor, SegformerForSemanticSegmentation
59
 
60
  image = cv2.imread('./example.jpg')
@@ -66,7 +67,7 @@ model = SegformerForSemanticSegmentation.from_pretrained("pamixsun/segformer_for
66
  inputs = processor(image, return_tensors="pt")
67
 
68
  with torch.no_grad():
69
- outputs = self.seg_model(**inputs)
70
  logits = outputs.logits.cpu()
71
 
72
  upsampled_logits = nn.functional.interpolate(
 
55
  import torch
56
  import numpy as np
57
 
58
+ from torch import nn
59
  from transformers import AutoImageProcessor, SegformerForSemanticSegmentation
60
 
61
  image = cv2.imread('./example.jpg')
 
67
  inputs = processor(image, return_tensors="pt")
68
 
69
  with torch.no_grad():
70
+ outputs = model(**inputs)
71
  logits = outputs.logits.cpu()
72
 
73
  upsampled_logits = nn.functional.interpolate(