You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a dataset by recursively crawling through a directory.
1254
+
Create or update dataset by recursively crawling through a directory.
1253
1255
A DatasetItem will be created for each unique image found.
1256
+
In case of update the existing items are skipped or updated depending on update_items param
1254
1257
1255
-
Parameters:
1258
+
Args:
1256
1259
dirname: Where to look for image files, recursively
1260
+
dataset_id: Dataset Id for update
1257
1261
dataset_name: If none is given, the parent folder name is used
1258
-
use_privacy_mode: Whether the dataset should be treated as privacy
1262
+
use_privacy_mode: Whether the dataset should be treated as privacy (ignored if dataset being updated)
1259
1263
privacy_mode_proxy: Endpoint that serves image files for privacy mode, ignore if not using privacy mode.
1260
1264
The proxy should work based on the relative path of the images in the directory.
1261
1265
allowed_file_types: Which file type extensions to search for, ie: ('jpg', 'png')
1262
1266
skip_size_warning: If False, it will throw an error if the script globs more than 500 images. This is a safety check in case the dirname has a typo, and grabs too much data.
1263
-
"""
1267
+
update_items: Whether to update items in existing dataset
1268
+
1269
+
Returns:
1270
+
:class: `Union[Dataset, None]`: Updated dataset or None if there wasn't a dataset to create
1264
1271
1272
+
"""
1273
+
ifdataset_id:
1274
+
existing_dataset=self.get_dataset(dataset_id)
1275
+
# fetch dataset use_privacy_mode for existence check
Create a dataset by recursively crawling through a directory.
1328
+
A DatasetItem will be created for each unique image found.
1329
+
1330
+
Parameters:
1331
+
dirname: Where to look for image files, recursively
1332
+
dataset_name: If none is given, the parent folder name is used
1333
+
use_privacy_mode: Whether the dataset should be treated as privacy
1334
+
privacy_mode_proxy: Endpoint that serves image files for privacy mode, ignore if not using privacy mode.
1335
+
The proxy should work based on the relative path of the images in the directory.
1336
+
allowed_file_types: Which file type extensions to search for, ie: ('jpg', 'png')
1337
+
skip_size_warning: If False, it will throw an error if the script globs more than 500 images. This is a safety check in case the dirname has a typo, and grabs too much data.
update dataset by recursively crawling through a directory.
1359
+
A DatasetItem will be created for each unique image found.
1360
+
The existing items are skipped or updated depending on update_items param
1361
+
1362
+
Args:
1363
+
dirname: Where to look for image files, recursively
1364
+
dataset_id: ID of existing dataset to update
1365
+
privacy_mode_proxy: Endpoint that serves image files for privacy mode, ignore if not using privacy mode.
1366
+
The proxy should work based on the relative path of the images in the directory.
1367
+
allowed_file_types: Which file type extensions to search for, ie: ('jpg', 'png')
1368
+
skip_size_warning: If False, it will throw an error if the script globs more than 500 images. This is a safety check in case the dirname has a typo, and grabs too much data.
1369
+
update_items: Whether to update items in existing dataset
0 commit comments