Spaces:
Running
Running
yu-rp
commited on
Commit
·
ba8ef2d
1
Parent(s):
ab0ee40
add examples
Browse files
app.py
CHANGED
@@ -35,24 +35,24 @@ def init_clip_examples():
|
|
35 |
"What fruit is in the left part of the fridge?",
|
36 |
"-",
|
37 |
"fruit",
|
38 |
-
|
39 |
-
|
40 |
"BICUBIC",
|
41 |
0,
|
42 |
-
"
|
43 |
-
"In the left part of the fridge, there are strawberries in a clear plastic container."
|
44 |
],
|
45 |
[
|
46 |
"https://raw.githubusercontent.com/yu-rp/asserts/main/API_Prompting/example_2_ori.jpg",
|
47 |
"https://raw.githubusercontent.com/yu-rp/asserts/main/API_Prompting/clip_example_2_masked.webp",
|
48 |
"On the right desk, what is to the left of the laptop?",
|
49 |
"-",
|
50 |
-
"
|
51 |
-
|
52 |
-
|
53 |
"BICUBIC",
|
54 |
-
|
55 |
-
"
|
56 |
"To the left of the laptop on the right desk, there is a desk lamp."
|
57 |
],
|
58 |
],
|
@@ -80,12 +80,12 @@ def init_llava_examples():
|
|
80 |
"Which direction is the red bird facing?",
|
81 |
" The red bird is facing away from the camera.</s>",
|
82 |
"red bird",
|
83 |
-
|
84 |
-
|
85 |
"BICUBIC",
|
86 |
-
|
87 |
"The red bird in the image is facing to the right.",
|
88 |
-
"The red bird is facing
|
89 |
],
|
90 |
[
|
91 |
"https://raw.githubusercontent.com/yu-rp/asserts/main/API_Prompting/example_2_ori.jpg",
|
@@ -93,12 +93,12 @@ def init_llava_examples():
|
|
93 |
"On the right desk, what is to the left of the laptop?",
|
94 |
" On the right desk, there is a lamp to the left of the laptop.</s>",
|
95 |
" On the right desk, there is a lamp to the left of the laptop.</s>",
|
96 |
-
|
97 |
-
|
98 |
"BICUBIC",
|
99 |
-
|
100 |
-
"
|
101 |
-
"To the left of the laptop on the right desk, there is a
|
102 |
],
|
103 |
],
|
104 |
[
|
@@ -151,7 +151,9 @@ def vqa(image, question, api_key):
|
|
151 |
]
|
152 |
}
|
153 |
],
|
154 |
-
"max_tokens": 300
|
|
|
|
|
155 |
}
|
156 |
|
157 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|
|
|
35 |
"What fruit is in the left part of the fridge?",
|
36 |
"-",
|
37 |
"fruit",
|
38 |
+
50,
|
39 |
+
5,
|
40 |
"BICUBIC",
|
41 |
0,
|
42 |
+
"In the left part of the fridge, there are strawberries and blueberries visible. The strawberries are in a clear plastic container, and the blueberries are in a similar container below the strawberries.",
|
43 |
+
"In the left part of the fridge, there are strawberries visible in a clear plastic container."
|
44 |
],
|
45 |
[
|
46 |
"https://raw.githubusercontent.com/yu-rp/asserts/main/API_Prompting/example_2_ori.jpg",
|
47 |
"https://raw.githubusercontent.com/yu-rp/asserts/main/API_Prompting/clip_example_2_masked.webp",
|
48 |
"On the right desk, what is to the left of the laptop?",
|
49 |
"-",
|
50 |
+
"laptop",
|
51 |
+
20,
|
52 |
+
9,
|
53 |
"BICUBIC",
|
54 |
+
200,
|
55 |
+
"To the left of the laptop on the right desk, there is a small potted plant.",
|
56 |
"To the left of the laptop on the right desk, there is a desk lamp."
|
57 |
],
|
58 |
],
|
|
|
80 |
"Which direction is the red bird facing?",
|
81 |
" The red bird is facing away from the camera.</s>",
|
82 |
"red bird",
|
83 |
+
50,
|
84 |
+
5,
|
85 |
"BICUBIC",
|
86 |
+
0,
|
87 |
"The red bird in the image is facing to the right.",
|
88 |
+
"The red bird on the right is facing to the left in the image."
|
89 |
],
|
90 |
[
|
91 |
"https://raw.githubusercontent.com/yu-rp/asserts/main/API_Prompting/example_2_ori.jpg",
|
|
|
93 |
"On the right desk, what is to the left of the laptop?",
|
94 |
" On the right desk, there is a lamp to the left of the laptop.</s>",
|
95 |
" On the right desk, there is a lamp to the left of the laptop.</s>",
|
96 |
+
50,
|
97 |
+
7,
|
98 |
"BICUBIC",
|
99 |
+
100,
|
100 |
+
"To the left of the laptop on the right desk, there is a small potted plant.",
|
101 |
+
"To the left of the laptop on the right desk, there is a desk lamp."
|
102 |
],
|
103 |
],
|
104 |
[
|
|
|
151 |
]
|
152 |
}
|
153 |
],
|
154 |
+
"max_tokens": 300,
|
155 |
+
"temperature": 0.0,
|
156 |
+
"top_p": 0.0,
|
157 |
}
|
158 |
|
159 |
response = requests.post("https://api.openai.com/v1/chat/completions", headers=headers, json=payload)
|