dgenerate-ultralytics-headless 8.3.137__py3-none-any.whl → 8.3.224__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dgenerate_ultralytics_headless-8.3.137.dist-info → dgenerate_ultralytics_headless-8.3.224.dist-info}/METADATA +41 -34
- dgenerate_ultralytics_headless-8.3.224.dist-info/RECORD +285 -0
- {dgenerate_ultralytics_headless-8.3.137.dist-info → dgenerate_ultralytics_headless-8.3.224.dist-info}/WHEEL +1 -1
- tests/__init__.py +7 -6
- tests/conftest.py +15 -39
- tests/test_cli.py +17 -17
- tests/test_cuda.py +17 -8
- tests/test_engine.py +36 -10
- tests/test_exports.py +98 -37
- tests/test_integrations.py +12 -15
- tests/test_python.py +126 -82
- tests/test_solutions.py +319 -135
- ultralytics/__init__.py +27 -9
- ultralytics/cfg/__init__.py +83 -87
- ultralytics/cfg/datasets/Argoverse.yaml +4 -4
- ultralytics/cfg/datasets/DOTAv1.5.yaml +2 -2
- ultralytics/cfg/datasets/DOTAv1.yaml +2 -2
- ultralytics/cfg/datasets/GlobalWheat2020.yaml +2 -2
- ultralytics/cfg/datasets/HomeObjects-3K.yaml +4 -5
- ultralytics/cfg/datasets/ImageNet.yaml +3 -3
- ultralytics/cfg/datasets/Objects365.yaml +24 -20
- ultralytics/cfg/datasets/SKU-110K.yaml +9 -9
- ultralytics/cfg/datasets/VOC.yaml +10 -13
- ultralytics/cfg/datasets/VisDrone.yaml +43 -33
- ultralytics/cfg/datasets/african-wildlife.yaml +5 -5
- ultralytics/cfg/datasets/brain-tumor.yaml +4 -5
- ultralytics/cfg/datasets/carparts-seg.yaml +5 -5
- ultralytics/cfg/datasets/coco-pose.yaml +26 -4
- ultralytics/cfg/datasets/coco.yaml +4 -4
- ultralytics/cfg/datasets/coco128-seg.yaml +2 -2
- ultralytics/cfg/datasets/coco128.yaml +2 -2
- ultralytics/cfg/datasets/coco8-grayscale.yaml +103 -0
- ultralytics/cfg/datasets/coco8-multispectral.yaml +2 -2
- ultralytics/cfg/datasets/coco8-pose.yaml +23 -2
- ultralytics/cfg/datasets/coco8-seg.yaml +2 -2
- ultralytics/cfg/datasets/coco8.yaml +2 -2
- ultralytics/cfg/datasets/construction-ppe.yaml +32 -0
- ultralytics/cfg/datasets/crack-seg.yaml +5 -5
- ultralytics/cfg/datasets/dog-pose.yaml +32 -4
- ultralytics/cfg/datasets/dota8-multispectral.yaml +2 -2
- ultralytics/cfg/datasets/dota8.yaml +2 -2
- ultralytics/cfg/datasets/hand-keypoints.yaml +29 -4
- ultralytics/cfg/datasets/lvis.yaml +9 -9
- ultralytics/cfg/datasets/medical-pills.yaml +4 -5
- ultralytics/cfg/datasets/open-images-v7.yaml +7 -10
- ultralytics/cfg/datasets/package-seg.yaml +5 -5
- ultralytics/cfg/datasets/signature.yaml +4 -4
- ultralytics/cfg/datasets/tiger-pose.yaml +20 -4
- ultralytics/cfg/datasets/xView.yaml +5 -5
- ultralytics/cfg/default.yaml +96 -93
- ultralytics/cfg/trackers/botsort.yaml +16 -17
- ultralytics/cfg/trackers/bytetrack.yaml +9 -11
- ultralytics/data/__init__.py +4 -4
- ultralytics/data/annotator.py +12 -12
- ultralytics/data/augment.py +531 -564
- ultralytics/data/base.py +76 -81
- ultralytics/data/build.py +206 -42
- ultralytics/data/converter.py +179 -78
- ultralytics/data/dataset.py +121 -121
- ultralytics/data/loaders.py +114 -91
- ultralytics/data/split.py +28 -15
- ultralytics/data/split_dota.py +67 -48
- ultralytics/data/utils.py +110 -89
- ultralytics/engine/exporter.py +422 -460
- ultralytics/engine/model.py +224 -252
- ultralytics/engine/predictor.py +94 -89
- ultralytics/engine/results.py +345 -595
- ultralytics/engine/trainer.py +231 -134
- ultralytics/engine/tuner.py +279 -73
- ultralytics/engine/validator.py +53 -46
- ultralytics/hub/__init__.py +26 -28
- ultralytics/hub/auth.py +30 -16
- ultralytics/hub/google/__init__.py +34 -36
- ultralytics/hub/session.py +53 -77
- ultralytics/hub/utils.py +23 -109
- ultralytics/models/__init__.py +1 -1
- ultralytics/models/fastsam/__init__.py +1 -1
- ultralytics/models/fastsam/model.py +36 -18
- ultralytics/models/fastsam/predict.py +33 -44
- ultralytics/models/fastsam/utils.py +4 -5
- ultralytics/models/fastsam/val.py +12 -14
- ultralytics/models/nas/__init__.py +1 -1
- ultralytics/models/nas/model.py +16 -20
- ultralytics/models/nas/predict.py +12 -14
- ultralytics/models/nas/val.py +4 -5
- ultralytics/models/rtdetr/__init__.py +1 -1
- ultralytics/models/rtdetr/model.py +9 -9
- ultralytics/models/rtdetr/predict.py +22 -17
- ultralytics/models/rtdetr/train.py +20 -16
- ultralytics/models/rtdetr/val.py +79 -59
- ultralytics/models/sam/__init__.py +8 -2
- ultralytics/models/sam/amg.py +53 -38
- ultralytics/models/sam/build.py +29 -31
- ultralytics/models/sam/model.py +33 -38
- ultralytics/models/sam/modules/blocks.py +159 -182
- ultralytics/models/sam/modules/decoders.py +38 -47
- ultralytics/models/sam/modules/encoders.py +114 -133
- ultralytics/models/sam/modules/memory_attention.py +38 -31
- ultralytics/models/sam/modules/sam.py +114 -93
- ultralytics/models/sam/modules/tiny_encoder.py +268 -291
- ultralytics/models/sam/modules/transformer.py +59 -66
- ultralytics/models/sam/modules/utils.py +55 -72
- ultralytics/models/sam/predict.py +745 -341
- ultralytics/models/utils/loss.py +118 -107
- ultralytics/models/utils/ops.py +118 -71
- ultralytics/models/yolo/__init__.py +1 -1
- ultralytics/models/yolo/classify/predict.py +28 -26
- ultralytics/models/yolo/classify/train.py +50 -81
- ultralytics/models/yolo/classify/val.py +68 -61
- ultralytics/models/yolo/detect/predict.py +12 -15
- ultralytics/models/yolo/detect/train.py +56 -46
- ultralytics/models/yolo/detect/val.py +279 -223
- ultralytics/models/yolo/model.py +167 -86
- ultralytics/models/yolo/obb/predict.py +7 -11
- ultralytics/models/yolo/obb/train.py +23 -25
- ultralytics/models/yolo/obb/val.py +107 -99
- ultralytics/models/yolo/pose/__init__.py +1 -1
- ultralytics/models/yolo/pose/predict.py +12 -14
- ultralytics/models/yolo/pose/train.py +31 -69
- ultralytics/models/yolo/pose/val.py +119 -254
- ultralytics/models/yolo/segment/predict.py +21 -25
- ultralytics/models/yolo/segment/train.py +12 -66
- ultralytics/models/yolo/segment/val.py +126 -305
- ultralytics/models/yolo/world/train.py +53 -45
- ultralytics/models/yolo/world/train_world.py +51 -32
- ultralytics/models/yolo/yoloe/__init__.py +7 -7
- ultralytics/models/yolo/yoloe/predict.py +30 -37
- ultralytics/models/yolo/yoloe/train.py +89 -71
- ultralytics/models/yolo/yoloe/train_seg.py +15 -17
- ultralytics/models/yolo/yoloe/val.py +56 -41
- ultralytics/nn/__init__.py +9 -11
- ultralytics/nn/autobackend.py +179 -107
- ultralytics/nn/modules/__init__.py +67 -67
- ultralytics/nn/modules/activation.py +8 -7
- ultralytics/nn/modules/block.py +302 -323
- ultralytics/nn/modules/conv.py +61 -104
- ultralytics/nn/modules/head.py +488 -186
- ultralytics/nn/modules/transformer.py +183 -123
- ultralytics/nn/modules/utils.py +15 -20
- ultralytics/nn/tasks.py +327 -203
- ultralytics/nn/text_model.py +81 -65
- ultralytics/py.typed +1 -0
- ultralytics/solutions/__init__.py +12 -12
- ultralytics/solutions/ai_gym.py +19 -27
- ultralytics/solutions/analytics.py +36 -26
- ultralytics/solutions/config.py +29 -28
- ultralytics/solutions/distance_calculation.py +23 -24
- ultralytics/solutions/heatmap.py +17 -19
- ultralytics/solutions/instance_segmentation.py +21 -19
- ultralytics/solutions/object_blurrer.py +16 -17
- ultralytics/solutions/object_counter.py +48 -53
- ultralytics/solutions/object_cropper.py +22 -16
- ultralytics/solutions/parking_management.py +61 -58
- ultralytics/solutions/queue_management.py +19 -19
- ultralytics/solutions/region_counter.py +63 -50
- ultralytics/solutions/security_alarm.py +22 -25
- ultralytics/solutions/similarity_search.py +107 -60
- ultralytics/solutions/solutions.py +343 -262
- ultralytics/solutions/speed_estimation.py +35 -31
- ultralytics/solutions/streamlit_inference.py +104 -40
- ultralytics/solutions/templates/similarity-search.html +31 -24
- ultralytics/solutions/trackzone.py +24 -24
- ultralytics/solutions/vision_eye.py +11 -12
- ultralytics/trackers/__init__.py +1 -1
- ultralytics/trackers/basetrack.py +18 -27
- ultralytics/trackers/bot_sort.py +48 -39
- ultralytics/trackers/byte_tracker.py +94 -94
- ultralytics/trackers/track.py +7 -16
- ultralytics/trackers/utils/gmc.py +37 -69
- ultralytics/trackers/utils/kalman_filter.py +68 -76
- ultralytics/trackers/utils/matching.py +13 -17
- ultralytics/utils/__init__.py +251 -275
- ultralytics/utils/autobatch.py +19 -7
- ultralytics/utils/autodevice.py +68 -38
- ultralytics/utils/benchmarks.py +169 -130
- ultralytics/utils/callbacks/base.py +12 -13
- ultralytics/utils/callbacks/clearml.py +14 -15
- ultralytics/utils/callbacks/comet.py +139 -66
- ultralytics/utils/callbacks/dvc.py +19 -27
- ultralytics/utils/callbacks/hub.py +8 -6
- ultralytics/utils/callbacks/mlflow.py +6 -10
- ultralytics/utils/callbacks/neptune.py +11 -19
- ultralytics/utils/callbacks/platform.py +73 -0
- ultralytics/utils/callbacks/raytune.py +3 -4
- ultralytics/utils/callbacks/tensorboard.py +9 -12
- ultralytics/utils/callbacks/wb.py +33 -30
- ultralytics/utils/checks.py +163 -114
- ultralytics/utils/cpu.py +89 -0
- ultralytics/utils/dist.py +24 -20
- ultralytics/utils/downloads.py +176 -146
- ultralytics/utils/errors.py +11 -13
- ultralytics/utils/events.py +113 -0
- ultralytics/utils/export/__init__.py +7 -0
- ultralytics/utils/{export.py → export/engine.py} +81 -63
- ultralytics/utils/export/imx.py +294 -0
- ultralytics/utils/export/tensorflow.py +217 -0
- ultralytics/utils/files.py +33 -36
- ultralytics/utils/git.py +137 -0
- ultralytics/utils/instance.py +105 -120
- ultralytics/utils/logger.py +404 -0
- ultralytics/utils/loss.py +99 -61
- ultralytics/utils/metrics.py +649 -478
- ultralytics/utils/nms.py +337 -0
- ultralytics/utils/ops.py +263 -451
- ultralytics/utils/patches.py +70 -31
- ultralytics/utils/plotting.py +253 -223
- ultralytics/utils/tal.py +48 -61
- ultralytics/utils/torch_utils.py +244 -251
- ultralytics/utils/tqdm.py +438 -0
- ultralytics/utils/triton.py +22 -23
- ultralytics/utils/tuner.py +11 -10
- dgenerate_ultralytics_headless-8.3.137.dist-info/RECORD +0 -272
- {dgenerate_ultralytics_headless-8.3.137.dist-info → dgenerate_ultralytics_headless-8.3.224.dist-info}/entry_points.txt +0 -0
- {dgenerate_ultralytics_headless-8.3.137.dist-info → dgenerate_ultralytics_headless-8.3.224.dist-info}/licenses/LICENSE +0 -0
- {dgenerate_ultralytics_headless-8.3.137.dist-info → dgenerate_ultralytics_headless-8.3.224.dist-info}/top_level.txt +0 -0
ultralytics/data/split_dota.py
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
|
2
2
|
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
3
5
|
import itertools
|
|
4
6
|
from glob import glob
|
|
5
7
|
from math import ceil
|
|
6
8
|
from pathlib import Path
|
|
9
|
+
from typing import Any
|
|
7
10
|
|
|
8
11
|
import cv2
|
|
9
12
|
import numpy as np
|
|
@@ -14,17 +17,16 @@ from ultralytics.utils import TQDM
|
|
|
14
17
|
from ultralytics.utils.checks import check_requirements
|
|
15
18
|
|
|
16
19
|
|
|
17
|
-
def bbox_iof(polygon1, bbox2, eps=1e-6):
|
|
18
|
-
"""
|
|
19
|
-
Calculate Intersection over Foreground (IoF) between polygons and bounding boxes.
|
|
20
|
+
def bbox_iof(polygon1: np.ndarray, bbox2: np.ndarray, eps: float = 1e-6) -> np.ndarray:
|
|
21
|
+
"""Calculate Intersection over Foreground (IoF) between polygons and bounding boxes.
|
|
20
22
|
|
|
21
23
|
Args:
|
|
22
|
-
polygon1 (np.ndarray): Polygon coordinates with shape (
|
|
23
|
-
bbox2 (np.ndarray): Bounding boxes with shape (
|
|
24
|
+
polygon1 (np.ndarray): Polygon coordinates with shape (N, 8).
|
|
25
|
+
bbox2 (np.ndarray): Bounding boxes with shape (N, 4).
|
|
24
26
|
eps (float, optional): Small value to prevent division by zero.
|
|
25
27
|
|
|
26
28
|
Returns:
|
|
27
|
-
(np.ndarray): IoF scores with shape (
|
|
29
|
+
(np.ndarray): IoF scores with shape (N, 1) or (N, M) if bbox2 is (M, 4).
|
|
28
30
|
|
|
29
31
|
Notes:
|
|
30
32
|
Polygon format: [x1, y1, x2, y2, x3, y3, x4, y4].
|
|
@@ -61,16 +63,15 @@ def bbox_iof(polygon1, bbox2, eps=1e-6):
|
|
|
61
63
|
return outputs
|
|
62
64
|
|
|
63
65
|
|
|
64
|
-
def load_yolo_dota(data_root, split="train"):
|
|
65
|
-
"""
|
|
66
|
-
Load DOTA dataset.
|
|
66
|
+
def load_yolo_dota(data_root: str, split: str = "train") -> list[dict[str, Any]]:
|
|
67
|
+
"""Load DOTA dataset annotations and image information.
|
|
67
68
|
|
|
68
69
|
Args:
|
|
69
70
|
data_root (str): Data root directory.
|
|
70
|
-
split (str): The split data set, could be
|
|
71
|
+
split (str, optional): The split data set, could be 'train' or 'val'.
|
|
71
72
|
|
|
72
73
|
Returns:
|
|
73
|
-
(
|
|
74
|
+
(list[dict[str, Any]]): List of annotation dictionaries containing image information.
|
|
74
75
|
|
|
75
76
|
Notes:
|
|
76
77
|
The directory structure assumed for the DOTA dataset:
|
|
@@ -97,19 +98,24 @@ def load_yolo_dota(data_root, split="train"):
|
|
|
97
98
|
return annos
|
|
98
99
|
|
|
99
100
|
|
|
100
|
-
def get_windows(
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
def get_windows(
|
|
102
|
+
im_size: tuple[int, int],
|
|
103
|
+
crop_sizes: tuple[int, ...] = (1024,),
|
|
104
|
+
gaps: tuple[int, ...] = (200,),
|
|
105
|
+
im_rate_thr: float = 0.6,
|
|
106
|
+
eps: float = 0.01,
|
|
107
|
+
) -> np.ndarray:
|
|
108
|
+
"""Get the coordinates of sliding windows for image cropping.
|
|
103
109
|
|
|
104
110
|
Args:
|
|
105
|
-
im_size (tuple): Original image size, (
|
|
106
|
-
crop_sizes (
|
|
107
|
-
gaps (
|
|
108
|
-
im_rate_thr (float): Threshold of windows areas divided by image areas.
|
|
109
|
-
eps (float): Epsilon value for math operations.
|
|
111
|
+
im_size (tuple[int, int]): Original image size, (H, W).
|
|
112
|
+
crop_sizes (tuple[int, ...], optional): Crop size of windows.
|
|
113
|
+
gaps (tuple[int, ...], optional): Gap between crops.
|
|
114
|
+
im_rate_thr (float, optional): Threshold of windows areas divided by image areas.
|
|
115
|
+
eps (float, optional): Epsilon value for math operations.
|
|
110
116
|
|
|
111
117
|
Returns:
|
|
112
|
-
(np.ndarray): Array of window coordinates
|
|
118
|
+
(np.ndarray): Array of window coordinates of shape (N, 4) where each row is [x_start, y_start, x_stop, y_stop].
|
|
113
119
|
"""
|
|
114
120
|
h, w = im_size
|
|
115
121
|
windows = []
|
|
@@ -144,8 +150,8 @@ def get_windows(im_size, crop_sizes=(1024,), gaps=(200,), im_rate_thr=0.6, eps=0
|
|
|
144
150
|
return windows[im_rates > im_rate_thr]
|
|
145
151
|
|
|
146
152
|
|
|
147
|
-
def get_window_obj(anno, windows, iof_thr=0.7):
|
|
148
|
-
"""Get objects for each window."""
|
|
153
|
+
def get_window_obj(anno: dict[str, Any], windows: np.ndarray, iof_thr: float = 0.7) -> list[np.ndarray]:
|
|
154
|
+
"""Get objects for each window based on IoF threshold."""
|
|
149
155
|
h, w = anno["ori_size"]
|
|
150
156
|
label = anno["label"]
|
|
151
157
|
if len(label):
|
|
@@ -158,17 +164,23 @@ def get_window_obj(anno, windows, iof_thr=0.7):
|
|
|
158
164
|
return [np.zeros((0, 9), dtype=np.float32) for _ in range(len(windows))] # window_anns
|
|
159
165
|
|
|
160
166
|
|
|
161
|
-
def crop_and_save(
|
|
162
|
-
|
|
163
|
-
|
|
167
|
+
def crop_and_save(
|
|
168
|
+
anno: dict[str, Any],
|
|
169
|
+
windows: np.ndarray,
|
|
170
|
+
window_objs: list[np.ndarray],
|
|
171
|
+
im_dir: str,
|
|
172
|
+
lb_dir: str,
|
|
173
|
+
allow_background_images: bool = True,
|
|
174
|
+
) -> None:
|
|
175
|
+
"""Crop images and save new labels for each window.
|
|
164
176
|
|
|
165
177
|
Args:
|
|
166
|
-
anno (dict): Annotation dict, including
|
|
167
|
-
windows (np.ndarray): Array of windows coordinates with shape (
|
|
168
|
-
window_objs (list): A list of labels inside each window.
|
|
178
|
+
anno (dict[str, Any]): Annotation dict, including 'filepath', 'label', 'ori_size' as its keys.
|
|
179
|
+
windows (np.ndarray): Array of windows coordinates with shape (N, 4).
|
|
180
|
+
window_objs (list[np.ndarray]): A list of labels inside each window.
|
|
169
181
|
im_dir (str): The output directory path of images.
|
|
170
182
|
lb_dir (str): The output directory path of labels.
|
|
171
|
-
allow_background_images (bool): Whether to include background images without labels.
|
|
183
|
+
allow_background_images (bool, optional): Whether to include background images without labels.
|
|
172
184
|
|
|
173
185
|
Notes:
|
|
174
186
|
The directory structure assumed for the DOTA dataset:
|
|
@@ -203,16 +215,21 @@ def crop_and_save(anno, windows, window_objs, im_dir, lb_dir, allow_background_i
|
|
|
203
215
|
f.write(f"{int(lb[0])} {' '.join(formatted_coords)}\n")
|
|
204
216
|
|
|
205
217
|
|
|
206
|
-
def split_images_and_labels(
|
|
207
|
-
|
|
208
|
-
|
|
218
|
+
def split_images_and_labels(
|
|
219
|
+
data_root: str,
|
|
220
|
+
save_dir: str,
|
|
221
|
+
split: str = "train",
|
|
222
|
+
crop_sizes: tuple[int, ...] = (1024,),
|
|
223
|
+
gaps: tuple[int, ...] = (200,),
|
|
224
|
+
) -> None:
|
|
225
|
+
"""Split both images and labels for a given dataset split.
|
|
209
226
|
|
|
210
227
|
Args:
|
|
211
228
|
data_root (str): Root directory of the dataset.
|
|
212
229
|
save_dir (str): Directory to save the split dataset.
|
|
213
|
-
split (str): The split data set, could be
|
|
214
|
-
crop_sizes (tuple): Tuple of crop sizes.
|
|
215
|
-
gaps (tuple): Tuple of gaps between crops.
|
|
230
|
+
split (str, optional): The split data set, could be 'train' or 'val'.
|
|
231
|
+
crop_sizes (tuple[int, ...], optional): Tuple of crop sizes.
|
|
232
|
+
gaps (tuple[int, ...], optional): Tuple of gaps between crops.
|
|
216
233
|
|
|
217
234
|
Notes:
|
|
218
235
|
The directory structure assumed for the DOTA dataset:
|
|
@@ -240,16 +257,17 @@ def split_images_and_labels(data_root, save_dir, split="train", crop_sizes=(1024
|
|
|
240
257
|
crop_and_save(anno, windows, window_objs, str(im_dir), str(lb_dir))
|
|
241
258
|
|
|
242
259
|
|
|
243
|
-
def split_trainval(
|
|
244
|
-
|
|
245
|
-
|
|
260
|
+
def split_trainval(
|
|
261
|
+
data_root: str, save_dir: str, crop_size: int = 1024, gap: int = 200, rates: tuple[float, ...] = (1.0,)
|
|
262
|
+
) -> None:
|
|
263
|
+
"""Split train and val sets of DOTA dataset with multiple scaling rates.
|
|
246
264
|
|
|
247
265
|
Args:
|
|
248
266
|
data_root (str): Root directory of the dataset.
|
|
249
267
|
save_dir (str): Directory to save the split dataset.
|
|
250
|
-
crop_size (int): Base crop size.
|
|
251
|
-
gap (int): Base gap between crops.
|
|
252
|
-
rates (tuple): Scaling rates for crop_size and gap.
|
|
268
|
+
crop_size (int, optional): Base crop size.
|
|
269
|
+
gap (int, optional): Base gap between crops.
|
|
270
|
+
rates (tuple[float, ...], optional): Scaling rates for crop_size and gap.
|
|
253
271
|
|
|
254
272
|
Notes:
|
|
255
273
|
The directory structure assumed for the DOTA dataset:
|
|
@@ -273,20 +291,21 @@ def split_trainval(data_root, save_dir, crop_size=1024, gap=200, rates=(1.0,)):
|
|
|
273
291
|
for r in rates:
|
|
274
292
|
crop_sizes.append(int(crop_size / r))
|
|
275
293
|
gaps.append(int(gap / r))
|
|
276
|
-
for split in
|
|
294
|
+
for split in {"train", "val"}:
|
|
277
295
|
split_images_and_labels(data_root, save_dir, split, crop_sizes, gaps)
|
|
278
296
|
|
|
279
297
|
|
|
280
|
-
def split_test(
|
|
281
|
-
|
|
282
|
-
|
|
298
|
+
def split_test(
|
|
299
|
+
data_root: str, save_dir: str, crop_size: int = 1024, gap: int = 200, rates: tuple[float, ...] = (1.0,)
|
|
300
|
+
) -> None:
|
|
301
|
+
"""Split test set of DOTA dataset, labels are not included within this set.
|
|
283
302
|
|
|
284
303
|
Args:
|
|
285
304
|
data_root (str): Root directory of the dataset.
|
|
286
305
|
save_dir (str): Directory to save the split dataset.
|
|
287
|
-
crop_size (int): Base crop size.
|
|
288
|
-
gap (int): Base gap between crops.
|
|
289
|
-
rates (tuple): Scaling rates for crop_size and gap.
|
|
306
|
+
crop_size (int, optional): Base crop size.
|
|
307
|
+
gap (int, optional): Base gap between crops.
|
|
308
|
+
rates (tuple[float, ...], optional): Scaling rates for crop_size and gap.
|
|
290
309
|
|
|
291
310
|
Notes:
|
|
292
311
|
The directory structure assumed for the DOTA dataset:
|