Wendy
commited on
Upload cogagent_infer.py with huggingface_hub
Browse files- cogagent_infer.py +2 -1
cogagent_infer.py
CHANGED
@@ -8,6 +8,7 @@ from typing import List
|
|
8 |
import json
|
9 |
from tqdm import tqdm
|
10 |
|
|
|
11 |
def draw_boxes_on_image(image: Image.Image, boxes: List[List[float]], save_path: str):
|
12 |
"""
|
13 |
Draws red bounding boxes on the given image and saves it.
|
@@ -123,7 +124,7 @@ def main():
|
|
123 |
with open(args.input_json, "r") as f:
|
124 |
data = json.load(f)
|
125 |
res = []
|
126 |
-
for i in tqdm(range(
|
127 |
x = data[i]
|
128 |
img_path = x['image']
|
129 |
image = Image.open(img_path).convert("RGB")
|
|
|
8 |
import json
|
9 |
from tqdm import tqdm
|
10 |
|
11 |
+
class
|
12 |
def draw_boxes_on_image(image: Image.Image, boxes: List[List[float]], save_path: str):
|
13 |
"""
|
14 |
Draws red bounding boxes on the given image and saves it.
|
|
|
124 |
with open(args.input_json, "r") as f:
|
125 |
data = json.load(f)
|
126 |
res = []
|
127 |
+
for i in tqdm(range(5)):
|
128 |
x = data[i]
|
129 |
img_path = x['image']
|
130 |
image = Image.open(img_path).convert("RGB")
|