Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings #270

Merged
merged 1 commit into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datumaro/cli/commands/explain.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def explain_command(args):
for item in dataset:
image = item.image.data
if image is None:
log.warn(
log.warning(
"Dataset item %s does not have image data. Skipping." % \
(item.id))
continue
Expand Down
4 changes: 2 additions & 2 deletions datumaro/components/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,8 +1032,8 @@ def _extractor_stats(extractor):
for item in extractor:
if not (item.has_image and item.image.has_data):
available = False
log.warn("Item %s has no image. Image stats won't be computed",
item.id)
log.warning("Item %s has no image, it will be excluded from "
"image stats", item.id)
break

stats = {
Expand Down
2 changes: 1 addition & 1 deletion datumaro/plugins/cifar_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def apply(self):
annotation_dict = {}
annotation_dict['filenames'] = filenames
annotation_dict['labels'] = labels
annotation_dict['data'] = np.array(data)
annotation_dict['data'] = np.array(data, dtype=object)
if len(image_sizes):
size = (CifarPath.IMAGE_SIZE, CifarPath.IMAGE_SIZE)
# 'image_sizes' isn't included in the standard format,
Expand Down
2 changes: 1 addition & 1 deletion datumaro/plugins/coco_format/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def save_annotations(self, item):
return

if not item.has_image:
log.warn("Item '%s': skipping writing instances "
log.warning("Item '%s': skipping writing instances "
"since no image info available" % item.id)
return
h, w = item.image.size
Expand Down
4 changes: 2 additions & 2 deletions datumaro/plugins/coco_format/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ def find_sources(path):
try:
ann_type = CocoTask[ann_type]
except KeyError:
log.warn("Skipping '%s': unknown subset "
log.warning("Skipping '%s': unknown subset "
"type '%s', the only known are: %s" % \
(subset_path, ann_type,
', '.join([e.name for e in CocoTask])))
', '.join(e.name for e in CocoTask)))
continue
subset_name = name_parts[1]
subsets[subset_name][ann_type] = subset_path
Expand Down
18 changes: 10 additions & 8 deletions datumaro/plugins/ndr.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@

class NDR(Transform, CliPlugin):
"""
Near-duplicated image removal |n
Removes near-duplicated images in subset |n
Example: control number of outputs to 100 after NDR |n
|s|s%(prog)s \ |n
|s|s|s|s--working_subset train \ |n
|s|s|s|s--algorithm gradient \ |n
|s|s|s|s--num_cut 100 \ |n
|s|s|s|s--over_sample random \ |n
Near-duplicated image removal.|n
|n
Removes near-duplicated images in subset|n
|n
Example: apply NDR, return no more than 100 images|n
|s|s%(prog)s|n
|s|s|s|s--working_subset train|n
|s|s|s|s--algorithm gradient|n
|s|s|s|s--num_cut 100|n
|s|s|s|s--over_sample random|n
|s|s|s|s--under_sample uniform
"""

Expand Down
2 changes: 1 addition & 1 deletion datumaro/plugins/yolo_format/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def apply(self):
if not subset_name or subset_name == DEFAULT_SUBSET_NAME:
subset_name = YoloPath.DEFAULT_SUBSET_NAME
elif subset_name not in YoloPath.SUBSET_NAMES:
log.warn("Skipping subset export '%s'. "
log.warning("Skipping subset export '%s'. "
"If specified, the only valid names are %s" % \
(subset_name, ', '.join(
"'%s'" % s for s in YoloPath.SUBSET_NAMES)))
Expand Down