yoon6173 commited on
Commit
f61f433
·
1 Parent(s): 8a40f69
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -22,17 +22,10 @@ def greet(url):
22
  masks_queries_logits = outputs.masks_queries_logits
23
 
24
  # you can pass them to processor for postprocessing
25
- predicted_semantic_map = processor.post_process_semantic_segmentation(outputs, target_sizes=[url.size])[0]
 
26
 
27
- sepia_filter = np.array([
28
- [0.393, 0.769, 0.189],
29
- [0.349, 0.686, 0.168],
30
- [0.272, 0.534, 0.131]
31
- ])
32
- sepia_img = predicted_semantic_map.dot(sepia_filter.T)
33
- sepia_img /= sepia_img.max()
34
-
35
- return sepia_img
36
 
37
 
38
  url = "http://images.cocodataset.org/val2017/000000039769.jpg"
 
22
  masks_queries_logits = outputs.masks_queries_logits
23
 
24
  # you can pass them to processor for postprocessing
25
+ predicted_semantic_map = processor.post_process_semantic_segmentation(outputs, target_sizes=[image.size])[0]
26
+ predicted_semantic_map = predicted_semantic_map.numpy()
27
 
28
+ return predicted_semantic_map
 
 
 
 
 
 
 
 
29
 
30
 
31
  url = "http://images.cocodataset.org/val2017/000000039769.jpg"