Kevin Sun commited on
Commit
76c0be6
1 Parent(s): 5b33e7b
Files changed (4) hide show
  1. app.py +1 -0
  2. configs/demo/pokemon.yaml +57 -0
  3. demo/pokemon.jpg +0 -0
  4. demo/superhero.jpeg +0 -0
app.py CHANGED
@@ -104,6 +104,7 @@ def visualize_segmentation(image,
104
  image[binary_final_mask > 0] = image[binary_final_mask > 0] * (1 - alpha)
105
  final_image = image + final_mask * alpha
106
  final_image = final_image.astype(np.uint8)
 
107
  ax.imshow(final_image)
108
  # Remove axis ticks and labels
109
  ax.axis('off')
 
104
  image[binary_final_mask > 0] = image[binary_final_mask > 0] * (1 - alpha)
105
  final_image = image + final_mask * alpha
106
  final_image = final_image.astype(np.uint8)
107
+ plt.subplots_adjust(left=0, right=1, top=1, bottom=0, wspace=0, hspace=0)
108
  ax.imshow(final_image)
109
  # Remove axis ticks and labels
110
  ax.axis('off')
configs/demo/pokemon.yaml ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ image_path: "demo/pokemon1.jpg"
2
+ image_caption: ['Charmander', 'Bulbasaur', 'Squirtle']
3
+
4
+ clip:
5
+ semantic_clip_model_name: 'ViT-L/14'
6
+ semantic_pretrained_data: 'openai'
7
+ clip_model_name: 'ViT-B/16'
8
+ pretrained_data: 'openai'
9
+
10
+ car:
11
+ iom_thres: 0.6
12
+ mask_threshold: 0.5
13
+ confidence_threshold: 0 # 0.2
14
+ clipes_threshold: 0.6
15
+ visual_prompt_type: ['gray', 'blur']
16
+ semantic_templates: ['a clean origami {}.',
17
+ 'a photo of a {}.',
18
+ 'This is a photo of a {}',
19
+ 'There is a {} in the scene',
20
+ 'There is the {} in the scene',
21
+ 'a photo of a {} in the scene',
22
+ 'a photo of a small {}.',
23
+ 'a photo of a medium {}.',
24
+ 'a photo of a large {}.',
25
+ 'This is a photo of a small {}.',
26
+ 'This is a photo of a medium {}.',
27
+ 'This is a photo of a large {}.',
28
+ 'There is a small {} in the scene.',
29
+ 'There is a medium {} in the scene.',
30
+ 'There is a large {} in the scene.']
31
+ bg_cls: ['ground', 'land', 'grass', 'tree', 'building',
32
+ 'wall', 'sky', 'lake', 'water', 'river', 'sea',
33
+ 'railway', 'railroad', 'helmet', 'cloud', 'house',
34
+ 'mountain', 'ocean', 'road', 'rock', 'street',
35
+ 'valley', 'bridge']
36
+
37
+ sam:
38
+ model_dir: "/homes/53/kevinsun/google-research/clip_as_rnn"
39
+ sam_checkpoint: "./sam_hq_vit_h.pth"
40
+ model_type: "vit_h"
41
+ min_pred_threshold: 0.01
42
+ points_per_side: 64
43
+ pred_iou_thresh: 0.88
44
+ stability_score_thresh: 0.95
45
+ box_nms_thresh: 0.7
46
+
47
+ test:
48
+ confidence_threshold: 0.7
49
+ algo: "maskcut"
50
+ ds_name: "voc"
51
+ seg_mode: "semantic"
52
+ split: 'val'
53
+ output_path: "./outputs/"
54
+ use_pseudo: False
55
+ # use_iterative: False
56
+ num_iteration: 1
57
+
demo/pokemon.jpg ADDED
demo/superhero.jpeg ADDED