Peijie commited on
Commit
66ba241
1 Parent(s): f6a672c

dev: add special case.

Browse files
Files changed (48) hide show
  1. app.py +12 -7
  2. data/image_embeddings/special_case_black.jpg.pt +3 -0
  3. data/image_embeddings/special_case_noise.jpg.pt +3 -0
  4. data/image_embeddings/special_case_parts.jpg.pt +3 -0
  5. data/images/boxes/special_case_black_back.jpg +0 -0
  6. data/images/boxes/special_case_black_beak.jpg +0 -0
  7. data/images/boxes/special_case_black_belly.jpg +0 -0
  8. data/images/boxes/special_case_black_breast.jpg +0 -0
  9. data/images/boxes/special_case_black_crown.jpg +0 -0
  10. data/images/boxes/special_case_black_eyes.jpg +0 -0
  11. data/images/boxes/special_case_black_forehead.jpg +0 -0
  12. data/images/boxes/special_case_black_legs.jpg +0 -0
  13. data/images/boxes/special_case_black_nape.jpg +0 -0
  14. data/images/boxes/special_case_black_tail.jpg +0 -0
  15. data/images/boxes/special_case_black_throat.jpg +0 -0
  16. data/images/boxes/special_case_black_wings.jpg +0 -0
  17. data/images/boxes/special_case_noise_back.jpg +0 -0
  18. data/images/boxes/special_case_noise_beak.jpg +0 -0
  19. data/images/boxes/special_case_noise_belly.jpg +0 -0
  20. data/images/boxes/special_case_noise_breast.jpg +0 -0
  21. data/images/boxes/special_case_noise_crown.jpg +0 -0
  22. data/images/boxes/special_case_noise_eyes.jpg +0 -0
  23. data/images/boxes/special_case_noise_forehead.jpg +0 -0
  24. data/images/boxes/special_case_noise_legs.jpg +0 -0
  25. data/images/boxes/special_case_noise_nape.jpg +0 -0
  26. data/images/boxes/special_case_noise_tail.jpg +0 -0
  27. data/images/boxes/special_case_noise_throat.jpg +0 -0
  28. data/images/boxes/special_case_noise_wings.jpg +0 -0
  29. data/images/boxes/special_case_parts_back.jpg +0 -0
  30. data/images/boxes/special_case_parts_beak.jpg +0 -0
  31. data/images/boxes/special_case_parts_belly.jpg +0 -0
  32. data/images/boxes/special_case_parts_breast.jpg +0 -0
  33. data/images/boxes/special_case_parts_crown.jpg +0 -0
  34. data/images/boxes/special_case_parts_eyes.jpg +0 -0
  35. data/images/boxes/special_case_parts_forehead.jpg +0 -0
  36. data/images/boxes/special_case_parts_legs.jpg +0 -0
  37. data/images/boxes/special_case_parts_nape.jpg +0 -0
  38. data/images/boxes/special_case_parts_tail.jpg +0 -0
  39. data/images/boxes/special_case_parts_throat.jpg +0 -0
  40. data/images/boxes/special_case_parts_wings.jpg +0 -0
  41. data/images/org/special_case_black.jpg +0 -0
  42. data/images/org/special_case_noise.jpg +0 -0
  43. data/images/org/special_case_parts.jpg +0 -0
  44. data/jsons/bs_name2cub_name.json +202 -0
  45. data/jsons/cub_vis_dict_binary.json +42 -0
  46. data/jsons/file_list.json +23 -1
  47. data/jsons/image2gt.json +0 -0
  48. utils/predict.py +1 -1
app.py CHANGED
@@ -1,7 +1,9 @@
1
  import io
2
  import os
3
- os.system("pip uninstall -y gradio")
4
- os.system("pip install gradio==3.41.0")
 
 
5
 
6
  import torch
7
  import json
@@ -24,7 +26,8 @@ XCLIP_DESC_PATH = "data/jsons/bs_cub_desc.json"
24
  XCLIP_DESC = json.load(open(XCLIP_DESC_PATH, "r"))
25
  PREPROCESS = lambda x: OWLVIT_PRECESSOR(images=x, return_tensors='pt')
26
  IMAGES_FOLDER = "data/images"
27
- XCLIP_RESULTS = json.load(open("data/jsons/xclip_org.json", "r"))
 
28
  CUB_DESC_EMBEDS = torch.load('data/text_embeddings/cub_200_desc.pt')
29
  CUB_IDX2NAME = json.load(open('data/jsons/cub_desc_idx2name.json', 'r'))
30
  CUB_IDX2NAME = {int(k): v for k, v in CUB_IDX2NAME.items()}
@@ -225,7 +228,7 @@ def update_selected_image(event: gr.SelectData):
225
  <img id="overlayImage" src="data:image/jpeg;base64,{BLANK_OVERLAY}" style="position:absolute; top:0; left:0; width:auto; height: {image_height}px; opacity: 0;">
226
  </div>
227
  """
228
- gt_label = XCLIP_RESULTS[image_name]['ground_truth']
229
  gt_class.state = gt_label
230
 
231
  # --- for initial value only ---
@@ -410,7 +413,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="PEEB") as demo:
410
  with gr.Row():
411
  # xclip_predict_button = gr.Button(label="Predict", value="Predict")
412
  xclip_predict_button = gr.Button(value="Predict")
413
- xclip_pred_label = gr.Markdown("### XCLIP:")
414
  xclip_explanation = gr.HTML()
415
 
416
  with gr.Column():
@@ -429,5 +432,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="PEEB") as demo:
429
  xclip_edit_button.click(on_edit_button_click_xclip, inputs=[], outputs=[xclip_textbox, custom_explanation])
430
  xclip_predict_button.click(on_predict_button_click_xclip, inputs=[xclip_textbox], outputs=[xclip_textbox, xclip_pred_label, xclip_explanation, custom_pred_label, custom_explanation])
431
 
432
- # demo.launch(server_port=5000, share=True)
433
- demo.launch()
 
 
 
1
  import io
2
  import os
3
+ debug = True
4
+ if not debug:
5
+ os.system("pip uninstall -y gradio")
6
+ os.system("pip install gradio==3.41.0")
7
 
8
  import torch
9
  import json
 
26
  XCLIP_DESC = json.load(open(XCLIP_DESC_PATH, "r"))
27
  PREPROCESS = lambda x: OWLVIT_PRECESSOR(images=x, return_tensors='pt')
28
  IMAGES_FOLDER = "data/images"
29
+ # XCLIP_RESULTS = json.load(open("data/jsons/xclip_org.json", "r"))
30
+ IMAGE2GT = json.load(open("data/jsons/image2gt.json", 'r'))
31
  CUB_DESC_EMBEDS = torch.load('data/text_embeddings/cub_200_desc.pt')
32
  CUB_IDX2NAME = json.load(open('data/jsons/cub_desc_idx2name.json', 'r'))
33
  CUB_IDX2NAME = {int(k): v for k, v in CUB_IDX2NAME.items()}
 
228
  <img id="overlayImage" src="data:image/jpeg;base64,{BLANK_OVERLAY}" style="position:absolute; top:0; left:0; width:auto; height: {image_height}px; opacity: 0;">
229
  </div>
230
  """
231
+ gt_label = IMAGE2GT[image_name]
232
  gt_class.state = gt_label
233
 
234
  # --- for initial value only ---
 
413
  with gr.Row():
414
  # xclip_predict_button = gr.Button(label="Predict", value="Predict")
415
  xclip_predict_button = gr.Button(value="Predict")
416
+ xclip_pred_label = gr.Markdown("### PEEB:")
417
  xclip_explanation = gr.HTML()
418
 
419
  with gr.Column():
 
432
  xclip_edit_button.click(on_edit_button_click_xclip, inputs=[], outputs=[xclip_textbox, custom_explanation])
433
  xclip_predict_button.click(on_predict_button_click_xclip, inputs=[xclip_textbox], outputs=[xclip_textbox, xclip_pred_label, xclip_explanation, custom_pred_label, custom_explanation])
434
 
435
+ if debug:
436
+ demo.launch(server_port=5000, share=True)
437
+ else:
438
+ demo.launch()
data/image_embeddings/special_case_black.jpg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a256e19b02f6c6a8d58acb22956bb3ebd6d89d7a869ffa21ee29b1c0a2fc307
3
+ size 1770791
data/image_embeddings/special_case_noise.jpg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:09684bd3cc77bc759fef4cc9db8e2e4e434daac18a87b89b5a7d7671ee66f6a0
3
+ size 1770791
data/image_embeddings/special_case_parts.jpg.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b13aea2bc3ebe761cddf48abae750677d3878b2669a70d15ebdce3dae7b6c0a0
3
+ size 1770791
data/images/boxes/special_case_black_back.jpg ADDED
data/images/boxes/special_case_black_beak.jpg ADDED
data/images/boxes/special_case_black_belly.jpg ADDED
data/images/boxes/special_case_black_breast.jpg ADDED
data/images/boxes/special_case_black_crown.jpg ADDED
data/images/boxes/special_case_black_eyes.jpg ADDED
data/images/boxes/special_case_black_forehead.jpg ADDED
data/images/boxes/special_case_black_legs.jpg ADDED
data/images/boxes/special_case_black_nape.jpg ADDED
data/images/boxes/special_case_black_tail.jpg ADDED
data/images/boxes/special_case_black_throat.jpg ADDED
data/images/boxes/special_case_black_wings.jpg ADDED
data/images/boxes/special_case_noise_back.jpg ADDED
data/images/boxes/special_case_noise_beak.jpg ADDED
data/images/boxes/special_case_noise_belly.jpg ADDED
data/images/boxes/special_case_noise_breast.jpg ADDED
data/images/boxes/special_case_noise_crown.jpg ADDED
data/images/boxes/special_case_noise_eyes.jpg ADDED
data/images/boxes/special_case_noise_forehead.jpg ADDED
data/images/boxes/special_case_noise_legs.jpg ADDED
data/images/boxes/special_case_noise_nape.jpg ADDED
data/images/boxes/special_case_noise_tail.jpg ADDED
data/images/boxes/special_case_noise_throat.jpg ADDED
data/images/boxes/special_case_noise_wings.jpg ADDED
data/images/boxes/special_case_parts_back.jpg ADDED
data/images/boxes/special_case_parts_beak.jpg ADDED
data/images/boxes/special_case_parts_belly.jpg ADDED
data/images/boxes/special_case_parts_breast.jpg ADDED
data/images/boxes/special_case_parts_crown.jpg ADDED
data/images/boxes/special_case_parts_eyes.jpg ADDED
data/images/boxes/special_case_parts_forehead.jpg ADDED
data/images/boxes/special_case_parts_legs.jpg ADDED
data/images/boxes/special_case_parts_nape.jpg ADDED
data/images/boxes/special_case_parts_tail.jpg ADDED
data/images/boxes/special_case_parts_throat.jpg ADDED
data/images/boxes/special_case_parts_wings.jpg ADDED
data/images/org/special_case_black.jpg ADDED
data/images/org/special_case_noise.jpg ADDED
data/images/org/special_case_parts.jpg ADDED
data/jsons/bs_name2cub_name.json ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "scarlet tanager": "Scarlet Tanager",
3
+ "gray kingbird": "Gray Kingbird",
4
+ "tennessee warbler": "Tennessee Warbler",
5
+ "red legged kittiwake": "Red-legged Kittiwake",
6
+ "black and white warbler": "Black-and-white Warbler",
7
+ "pied kingfisher": "Pied Kingfisher",
8
+ "yellow bellied flycatcher": "Yellow-bellied Flycatcher",
9
+ "palm warbler": "Palm Warbler",
10
+ "tree sparrow": "Tree Sparrow",
11
+ "red breasted merganser": "Red-breasted Merganser",
12
+ "crested auklet": "Crested Auklet",
13
+ "northern fulmar": "Northern Fulmar",
14
+ "caspian tern": "Caspian Tern",
15
+ "green violetear": "Green Violetear",
16
+ "artic tern": "Artic Tern",
17
+ "tree swallow": "Tree Swallow",
18
+ "nighthawk": "Nighthawk",
19
+ "eastern towhee": "Eastern Towhee",
20
+ "black billed cuckoo": "Black-billed Cuckoo",
21
+ "sooty albatross": "Sooty Albatross",
22
+ "carolina wren": "Carolina Wren",
23
+ "red bellied woodpecker": "Red-bellied Woodpecker",
24
+ "boat tailed grackle": "Boat-tailed Grackle",
25
+ "common raven": "Common Raven",
26
+ "parakeet auklet": "Parakeet Auklet",
27
+ "cedar waxwing": "Cedar Waxwing",
28
+ "lincoln sparrow": "Lincoln Sparrow",
29
+ "geococcyx": "Geococcyx",
30
+ "rose breasted grosbeak": "Rose-breasted Grosbeak",
31
+ "ivory gull": "Ivory Gull",
32
+ "black tern": "Black Tern",
33
+ "rock wren": "Rock Wren",
34
+ "cardinal": "Cardinal",
35
+ "seaside sparrow": "Seaside Sparrow",
36
+ "northern waterthrush": "Northern Waterthrush",
37
+ "northern flicker": "Northern Flicker",
38
+ "acadian flycatcher": "Acadian Flycatcher",
39
+ "bank swallow": "Bank Swallow",
40
+ "red winged blackbird": "Red-winged Blackbird",
41
+ "lazuli bunting": "Lazuli Bunting",
42
+ "ringed kingfisher": "Ringed Kingfisher",
43
+ "barn swallow": "Barn Swallow",
44
+ "ruby throated hummingbird": "Ruby-throated Hummingbird",
45
+ "orange crowned warbler": "Orange-crowned Warbler",
46
+ "worm eating warbler": "Worm-eating Warbler",
47
+ "pine warbler": "Pine Warbler",
48
+ "prothonotary warbler": "Prothonotary Warbler",
49
+ "philadelphia vireo": "Philadelphia Vireo",
50
+ "evening grosbeak": "Evening Grosbeak",
51
+ "western gull": "Western Gull",
52
+ "swainson warbler": "Swainson Warbler",
53
+ "cerulean warbler": "Cerulean Warbler",
54
+ "marsh wren": "Marsh Wren",
55
+ "prairie warbler": "Prairie Warbler",
56
+ "hooded oriole": "Hooded Oriole",
57
+ "le conte sparrow": "Le-Conte Sparrow",
58
+ "white breasted kingfisher": "White-breasted Kingfisher",
59
+ "green tailed towhee": "Green-tailed Towhee",
60
+ "belted kingfisher": "Belted Kingfisher",
61
+ "nashville warbler": "Nashville Warbler",
62
+ "american crow": "American Crow",
63
+ "yellow warbler": "Yellow Warbler",
64
+ "field sparrow": "Field Sparrow",
65
+ "pine grosbeak": "Pine Grosbeak",
66
+ "chipping sparrow": "Chipping Sparrow",
67
+ "rhinoceros auklet": "Rhinoceros Auklet",
68
+ "rufous hummingbird": "Rufous Hummingbird",
69
+ "orchard oriole": "Orchard Oriole",
70
+ "scott oriole": "Scott Oriole",
71
+ "black capped vireo": "Black-capped Vireo",
72
+ "common tern": "Common Tern",
73
+ "forster tern": "Forsters Tern",
74
+ "warbling vireo": "Warbling Vireo",
75
+ "house wren": "House Wren",
76
+ "pelagic cormorant": "Pelagic Cormorant",
77
+ "grasshopper sparrow": "Grasshopper Sparrow",
78
+ "red cockaded woodpecker": "Red-cockaded Woodpecker",
79
+ "mangrove cuckoo": "Mangrove Cuckoo",
80
+ "anna hummingbird": "Anna Hummingbird",
81
+ "gray catbird": "Gray Catbird",
82
+ "laysan albatross": "Laysan Albatross",
83
+ "glaucous winged gull": "Glaucous-winged Gull",
84
+ "eared grebe": "Eared Grebe",
85
+ "yellow throated vireo": "Yellow-throated Vireo",
86
+ "louisiana waterthrush": "Louisiana Waterthrush",
87
+ "bay breasted warbler": "Bay-breasted Warbler",
88
+ "pigeon guillemot": "Pigeon Guillemot",
89
+ "yellow headed blackbird": "Yellow-headed Blackbird",
90
+ "black footed albatross": "Black-footed Albatross",
91
+ "cactus wren": "Cactus Wren",
92
+ "kentucky warbler": "Kentucky Warbler",
93
+ "brewer blackbird": "Brewer Blackbird",
94
+ "mallard": "Mallard",
95
+ "blue grosbeak": "Blue Grosbeak",
96
+ "baltimore oriole": "Baltimore Oriole",
97
+ "myrtle warbler": "Myrtle Warbler",
98
+ "least auklet": "Least Auklet",
99
+ "cape may warbler": "Cape-May Warbler",
100
+ "green jay": "Green Jay",
101
+ "chestnut sided warbler": "Chestnut-sided Warbler",
102
+ "bohemian waxwing": "Bohemian Waxwing",
103
+ "frigatebird": "Frigatebird",
104
+ "bronzed cowbird": "Bronzed Cowbird",
105
+ "red faced cormorant": "Red-faced Cormorant",
106
+ "brown creeper": "Brown Creeper",
107
+ "nelson sharp tailed sparrow": "Nelson-Sharp-tailed Sparrow",
108
+ "western meadowlark": "Western Meadowlark",
109
+ "horned puffin": "Horned Puffin",
110
+ "indigo bunting": "Indigo Bunting",
111
+ "cliff swallow": "Cliff Swallow",
112
+ "loggerhead shrike": "Loggerhead Shrike",
113
+ "black throated sparrow": "Black-throated Sparrow",
114
+ "blue winged warbler": "Blue-winged Warbler",
115
+ "white pelican": "White Pelican",
116
+ "magnolia warbler": "Magnolia Warbler",
117
+ "great crested flycatcher": "Great-Crested Flycatcher",
118
+ "american three toed woodpecker": "American-Three-toed Woodpecker",
119
+ "yellow breasted chat": "Yellow-breasted Chat",
120
+ "harris sparrow": "Harris Sparrow",
121
+ "heermann gull": "Heermann Gull",
122
+ "white throated sparrow": "White-throated Sparrow",
123
+ "song sparrow": "Song Sparrow",
124
+ "brewer sparrow": "Brewer Sparrow",
125
+ "western wood pewee": "Western-Wood Pewee",
126
+ "hooded merganser": "Hooded Merganser",
127
+ "white breasted nuthatch": "White-breasted Nuthatch",
128
+ "american redstart": "American Redstart",
129
+ "horned lark": "Horned Lark",
130
+ "brown thrasher": "Brown Thrasher",
131
+ "hooded warbler": "Hooded Warbler",
132
+ "clay colored sparrow": "Clay-colored Sparrow",
133
+ "gray crowned rosy finch": "Gray-crowned-Rosy Finch",
134
+ "white crowned sparrow": "White-crowned Sparrow",
135
+ "brown pelican": "Brown Pelican",
136
+ "sayornis": "Sayornis",
137
+ "herring gull": "Herring Gull",
138
+ "vermilion flycatcher": "Vermilion Flycatcher",
139
+ "clark nutcracker": "Clark Nutcracker",
140
+ "sage thrasher": "Sage Thrasher",
141
+ "yellow billed cuckoo": "Yellow-billed Cuckoo",
142
+ "ovenbird": "Ovenbird",
143
+ "gadwall": "Gadwall",
144
+ "dark eyed junco": "Dark-eyed Junco",
145
+ "pied billed grebe": "Pied-billed Grebe",
146
+ "least flycatcher": "Least Flycatcher",
147
+ "elegant tern": "Elegant Tern",
148
+ "red headed woodpecker": "Red-headed Woodpecker",
149
+ "fox sparrow": "Fox Sparrow",
150
+ "downy woodpecker": "Downy Woodpecker",
151
+ "european goldfinch": "European Goldfinch",
152
+ "great grey shrike": "Great-Grey Shrike",
153
+ "pomarine jaeger": "Pomarine Jaeger",
154
+ "slaty backed gull": "Slaty-backed Gull",
155
+ "purple finch": "Purple Finch",
156
+ "mourning warbler": "Mourning Warbler",
157
+ "rusty blackbird": "Rusty Blackbird",
158
+ "white necked raven": "White-necked Raven",
159
+ "bobolink": "Bobolink",
160
+ "vesper sparrow": "Vesper Sparrow",
161
+ "ring billed gull": "Ring-billed Gull",
162
+ "red eyed vireo": "Red-eyed Vireo",
163
+ "green kingfisher": "Green Kingfisher",
164
+ "wilson warbler": "Wilson Warbler",
165
+ "western grebe": "Western Grebe",
166
+ "brandt cormorant": "Brandt Cormorant",
167
+ "pileated woodpecker": "Pileated Woodpecker",
168
+ "house sparrow": "House Sparrow",
169
+ "canada warbler": "Canada Warbler",
170
+ "florida jay": "Florida Jay",
171
+ "pacific loon": "Pacific Loon",
172
+ "summer tanager": "Summer Tanager",
173
+ "blue headed vireo": "Blue-headed Vireo",
174
+ "least tern": "Least Tern",
175
+ "american goldfinch": "American Goldfinch",
176
+ "savannah sparrow": "Savannah Sparrow",
177
+ "scissor tailed flycatcher": "Scissor-tailed Flycatcher",
178
+ "horned grebe": "Horned Grebe",
179
+ "baird sparrow": "Baird Sparrow",
180
+ "cape glossy starling": "Cape-Glossy Starling",
181
+ "winter wren": "Winter Wren",
182
+ "painted bunting": "Painted Bunting",
183
+ "tropical kingbird": "Tropical Kingbird",
184
+ "long tailed jaeger": "Long-tailed Jaeger",
185
+ "fish crow": "Fish Crow",
186
+ "chuck will widow": "Chuck-will Widow",
187
+ "white eyed vireo": "White-eyed Vireo",
188
+ "bewick wren": "Bewick Wren",
189
+ "henslow sparrow": "Henslow Sparrow",
190
+ "groove billed ani": "Groove-billed Ani",
191
+ "golden winged warbler": "Golden-winged Warbler",
192
+ "california gull": "California Gull",
193
+ "black throated blue warbler": "Black-throated-Blue Warbler",
194
+ "american pipit": "American Pipit",
195
+ "common yellowthroat": "Common Yellowthroat",
196
+ "mockingbird": "Mockingbird",
197
+ "blue jay": "Blue Jay",
198
+ "whip poor will": "Whip-poor Will",
199
+ "olive sided flycatcher": "Olive-sided Flycatcher",
200
+ "shiny cowbird": "Shiny Cowbird",
201
+ "spotted catbird": "Spotted Catbird"
202
+ }
data/jsons/cub_vis_dict_binary.json CHANGED
@@ -165030,5 +165030,47 @@
165030
  "nape": true,
165031
  "legs": true,
165032
  "tail": true
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165033
  }
165034
  }
 
165030
  "nape": true,
165031
  "legs": true,
165032
  "tail": true
165033
+ },
165034
+ "special_case_black.jpg": {
165035
+ "crown": true,
165036
+ "forehead": true,
165037
+ "eyes": true,
165038
+ "beak": true,
165039
+ "throat": true,
165040
+ "belly": true,
165041
+ "breast": true,
165042
+ "back": true,
165043
+ "wings": true,
165044
+ "nape": true,
165045
+ "legs": true,
165046
+ "tail": true
165047
+ },
165048
+ "special_case_noise.jpg": {
165049
+ "crown": true,
165050
+ "forehead": true,
165051
+ "eyes": true,
165052
+ "beak": true,
165053
+ "throat": true,
165054
+ "belly": true,
165055
+ "breast": true,
165056
+ "back": true,
165057
+ "wings": true,
165058
+ "nape": true,
165059
+ "legs": true,
165060
+ "tail": true
165061
+ },
165062
+ "special_case_parts.jpg": {
165063
+ "crown": true,
165064
+ "forehead": true,
165065
+ "eyes": true,
165066
+ "beak": true,
165067
+ "throat": true,
165068
+ "belly": true,
165069
+ "breast": true,
165070
+ "back": true,
165071
+ "wings": true,
165072
+ "nape": true,
165073
+ "legs": true,
165074
+ "tail": true
165075
  }
165076
  }
data/jsons/file_list.json CHANGED
@@ -1 +1,23 @@
1
- ["Brandt_Cormorant_0040_23144.jpg", "Black_Tern_0101_144331.jpg", "Gray_Catbird_0071_20974.jpg", "Rufous_Hummingbird_0076_59563.jpg", "Ivory_Gull_0004_49019.jpg", "Brown_Thrasher_0014_155421.jpg", "American_Goldfinch_0123_32505.jpg", "Red_Headed_Woodpecker_0032_182815.jpg", "Sage_Thrasher_0062_796462.jpg", "Heermann_Gull_0097_45783.jpg", "Winter_Wren_0048_189683.jpg", "Pine_Warbler_0113_172456.jpg", "White_Eyed_Vireo_0046_158849.jpg", "Cedar_Waxwing_0075_179114.jpg", "Carolina_Wren_0060_186296.jpg", "Clark_Nutcracker_0126_85134.jpg", "House_Wren_0137_187273.jpg", "Vesper_Sparrow_0030_125663.jpg", "Northern_Waterthrush_0038_177027.jpg", "Western_Grebe_0064_36613.jpg"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ["Brandt_Cormorant_0040_23144.jpg",
2
+ "Black_Tern_0101_144331.jpg",
3
+ "Gray_Catbird_0071_20974.jpg",
4
+ "Rufous_Hummingbird_0076_59563.jpg",
5
+ "Ivory_Gull_0004_49019.jpg",
6
+ "Brown_Thrasher_0014_155421.jpg",
7
+ "American_Goldfinch_0123_32505.jpg",
8
+ "Red_Headed_Woodpecker_0032_182815.jpg",
9
+ "Sage_Thrasher_0062_796462.jpg",
10
+ "Heermann_Gull_0097_45783.jpg",
11
+ "Winter_Wren_0048_189683.jpg",
12
+ "Pine_Warbler_0113_172456.jpg",
13
+ "White_Eyed_Vireo_0046_158849.jpg",
14
+ "Cedar_Waxwing_0075_179114.jpg",
15
+ "Carolina_Wren_0060_186296.jpg",
16
+ "Clark_Nutcracker_0126_85134.jpg",
17
+ "House_Wren_0137_187273.jpg",
18
+ "Vesper_Sparrow_0030_125663.jpg",
19
+ "Northern_Waterthrush_0038_177027.jpg",
20
+ "Western_Grebe_0064_36613.jpg",
21
+ "special_case_black.jpg",
22
+ "special_case_noise.jpg",
23
+ "special_case_parts.jpg"]
data/jsons/image2gt.json ADDED
The diff for this file is too large to render. See raw diff
 
utils/predict.py CHANGED
@@ -90,8 +90,8 @@ def xclip_pred(new_desc: dict,
90
  part_embeds = owlvit_processor(text=[ORG_PART_ORDER], return_tensors="pt").to(device)
91
  if use_precompute_embeddings:
92
  image_embeds = torch.load(f'data/image_embeddings/{image_name}.pt').to(device)
93
- image_input = owlvit_processor(images=image, return_tensors='pt').to(device)
94
  else:
 
95
  image_embeds, _ = model.image_embedder(pixel_values = image_input['pixel_values'])
96
 
97
  pred_logits, part_logits, output_dict = model(image_embeds, part_embeds, query_embeds, None)
 
90
  part_embeds = owlvit_processor(text=[ORG_PART_ORDER], return_tensors="pt").to(device)
91
  if use_precompute_embeddings:
92
  image_embeds = torch.load(f'data/image_embeddings/{image_name}.pt').to(device)
 
93
  else:
94
+ image_input = owlvit_processor(images=image, return_tensors='pt').to(device)
95
  image_embeds, _ = model.image_embedder(pixel_values = image_input['pixel_values'])
96
 
97
  pred_logits, part_logits, output_dict = model(image_embeds, part_embeds, query_embeds, None)