Wendy commited on
Commit
940b5b6
·
verified ·
1 Parent(s): 84e1125

Upload cogagent_infer.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. 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(len(data))):
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")