No more Tuple, List, Dict (#38797)
* No more Tuple, List, Dict * make fixup * More style fixes * Docstring fixes with regex replacement * Trigger tests * Redo fixes after rebase * Fix copies * [test all] * update * [test all] * update * [test all] * make style after rebase * Patch the hf_argparser test * Patch the hf_argparser test * style fixes * style fixes * style fixes * Fix docstrings in Cohere test * [test all] --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -243,7 +243,7 @@ and it uses the exact same dataset as an example. Apply some geometric and color
|
||||
... )
|
||||
```
|
||||
|
||||
The `image_processor` expects the annotations to be in the following format: `{'image_id': int, 'annotations': List[Dict]}`,
|
||||
The `image_processor` expects the annotations to be in the following format: `{'image_id': int, 'annotations': list[Dict]}`,
|
||||
where each dictionary is a COCO object annotation. Let's add a function to reformat annotations for a single example:
|
||||
|
||||
```py
|
||||
@@ -252,9 +252,9 @@ The `image_processor` expects the annotations to be in the following format: `{'
|
||||
|
||||
... Args:
|
||||
... image_id (str): image id. e.g. "0001"
|
||||
... categories (List[int]): list of categories/class labels corresponding to provided bounding boxes
|
||||
... areas (List[float]): list of corresponding areas to provided bounding boxes
|
||||
... bboxes (List[Tuple[float]]): list of bounding boxes provided in COCO format
|
||||
... categories (list[int]): list of categories/class labels corresponding to provided bounding boxes
|
||||
... areas (list[float]): list of corresponding areas to provided bounding boxes
|
||||
... bboxes (list[tuple[float]]): list of bounding boxes provided in COCO format
|
||||
... ([center_x, center_y, width, height] in absolute coordinates)
|
||||
|
||||
... Returns:
|
||||
@@ -397,7 +397,7 @@ Intermediate format of boxes used for training is `YOLO` (normalized) but we wil
|
||||
|
||||
... Args:
|
||||
... boxes (torch.Tensor): Bounding boxes in YOLO format
|
||||
... image_size (Tuple[int, int]): Image size in format (height, width)
|
||||
... image_size (tuple[int, int]): Image size in format (height, width)
|
||||
|
||||
... Returns:
|
||||
... torch.Tensor: Bounding boxes in Pascal VOC format (x_min, y_min, x_max, y_max)
|
||||
|
||||
Reference in New Issue
Block a user