Commit
Β·
0f5bdf8
1
Parent(s):
dcd58a3
Fix: img embeddings prompt position
Browse files- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_a.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_cyclists.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_group.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_nearby.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_ocean.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_of.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_riding.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_the.png +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmaps.json +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/image.jpg +0 -0
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/img_url.txt +0 -0
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/preview_first_token.jpg +2 -2
- examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/prompt.txt +0 -0
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_computer.png +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_in.png +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_jobs.png +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_science.png +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_usa.png +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmaps.json +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/image.jpg +0 -0
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/img_url.txt +0 -0
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/preview_first_token.jpg +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/prompt.txt +0 -0
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_bangladesh.png +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_choices.png +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_graph.png +2 -2
- examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_in.png +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_of.png +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_profession.png +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmaps.json +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/image.jpg +0 -0
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/img_url.txt +0 -0
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/preview_first_token.jpg +2 -2
- examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/prompt.txt +0 -0
- similarity.py +2 -2
- test.py +4 -4
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_a.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_cyclists.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_group.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_nearby.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_ocean.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_of.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_riding.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmap_the.png
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/heatmaps.json
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:da1ed693540d83d180048157ca1af810a29128a48c80bfff01494aa114a2036a
|
3 |
+
size 11108408
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/image.jpg
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/img_url.txt
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/preview_first_token.jpg
RENAMED
File without changes
|
examples/{auto_a_group_of_cyclists_riding_nea_20250711_210229 β auto_a_group_of_cyclists_riding_nea_20250724_104818}/prompt.txt
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_computer.png
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_in.png
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_jobs.png
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_science.png
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmap_usa.png
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/heatmaps.json
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:887d8b4d5e0356a883d1c9111394f7f77c5218f09b40902a3b7cb389e5150bdf
|
3 |
+
size 4641044
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/image.jpg
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/img_url.txt
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/preview_first_token.jpg
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_computer_science_jobs_in_usa_20250724_104828}/prompt.txt
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_bangladesh.png
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_choices.png
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_graph.png
RENAMED
File without changes
|
examples/{auto_computer_science_jobs_in_usa_20250711_205931 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_in.png
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_of.png
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmap_profession.png
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/heatmaps.json
RENAMED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9dfa09934a3b8937c933ab8a3df57ad1b177fdb747ab004c4401bfd736e60fd9
|
3 |
+
size 4308932
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/image.jpg
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/img_url.txt
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/preview_first_token.jpg
RENAMED
File without changes
|
examples/{auto_graph_of_profession_choices_in_20250711_205556 β auto_graph_of_profession_choices_in_20250724_104837}/prompt.txt
RENAMED
File without changes
|
similarity.py
CHANGED
@@ -223,8 +223,8 @@ class JinaV4SimilarityMapper:
|
|
223 |
image_embeddings = image_embeddings[0]
|
224 |
|
225 |
# Remove special tokens
|
226 |
-
vision_start_position_from_start =
|
227 |
-
vision_end_position_from_end =
|
228 |
image_embeddings = image_embeddings[vision_start_position_from_start:-vision_end_position_from_end]
|
229 |
|
230 |
return pil_image, image_embeddings, size, (grid_height, grid_width)
|
|
|
223 |
image_embeddings = image_embeddings[0]
|
224 |
|
225 |
# Remove special tokens
|
226 |
+
vision_start_position_from_start = 4
|
227 |
+
vision_end_position_from_end = 7
|
228 |
image_embeddings = image_embeddings[vision_start_position_from_start:-vision_end_position_from_end]
|
229 |
|
230 |
return pil_image, image_embeddings, size, (grid_height, grid_width)
|
test.py
CHANGED
@@ -16,13 +16,13 @@ api_key = os.getenv("JINA_TOKEN")
|
|
16 |
MAPPER.model.set_api_key(api_key)
|
17 |
|
18 |
inputs = [
|
19 |
-
("A
|
20 |
-
("
|
21 |
-
("Graph of profession choices in
|
22 |
]
|
23 |
|
24 |
for input in inputs:
|
25 |
-
img_proc, _
|
26 |
toks, maps = MAPPER.get_token_similarity_maps(input[0], img_proc)
|
27 |
save_run(input[0], input[1], img_proc, maps)
|
28 |
|
|
|
16 |
MAPPER.model.set_api_key(api_key)
|
17 |
|
18 |
inputs = [
|
19 |
+
("A group of cyclists riding nearby the ocean", "https://cdn.duvine.com/wp-content/uploads/2016/04/17095703/Slides_mallorca_FOR-WEB.jpg"),
|
20 |
+
("Computer Science jobs in USA", "https://www.ayresassociates.com/wp-content/uploads/2019/02/Career-Expo-Pie-Chart-Crop.jpg"),
|
21 |
+
("Graph of profession choices in Bangladesh", "https://notepadacademy.com/wp-content/uploads/2023/08/image.png")
|
22 |
]
|
23 |
|
24 |
for input in inputs:
|
25 |
+
img_proc, *_ = MAPPER.process_image(input[1])
|
26 |
toks, maps = MAPPER.get_token_similarity_maps(input[0], img_proc)
|
27 |
save_run(input[0], input[1], img_proc, maps)
|
28 |
|