✏️ [Fix] a typo of dataset name, and remove warning
Browse files- utils/converter_json2txt.py +2 -0
- utils/dataloader.py +1 -1
utils/converter_json2txt.py
CHANGED
|
@@ -25,6 +25,8 @@ def process_annotations(
|
|
| 25 |
"""
|
| 26 |
for image_id, annotations in tqdm(image_annotations.items(), desc="Processing annotations"):
|
| 27 |
file_path = os.path.join(output_dir, f"{image_id:0>12}.txt")
|
|
|
|
|
|
|
| 28 |
with open(file_path, "w") as file:
|
| 29 |
for annotation in annotations:
|
| 30 |
process_annotation(annotation, image_info_dict[image_id], id_to_idx, file)
|
|
|
|
| 25 |
"""
|
| 26 |
for image_id, annotations in tqdm(image_annotations.items(), desc="Processing annotations"):
|
| 27 |
file_path = os.path.join(output_dir, f"{image_id:0>12}.txt")
|
| 28 |
+
if not annotations:
|
| 29 |
+
continue
|
| 30 |
with open(file_path, "w") as file:
|
| 31 |
for annotation in annotations:
|
| 32 |
process_annotation(annotation, image_info_dict[image_id], id_to_idx, file)
|
utils/dataloader.py
CHANGED
|
@@ -45,7 +45,7 @@ class YoloDataset(Dataset):
|
|
| 45 |
if data is None:
|
| 46 |
logger.info("Generating {} cache", phase_name)
|
| 47 |
images_path = path.join(dataset_path, "images", phase_name)
|
| 48 |
-
labels_path = path.join(dataset_path, "
|
| 49 |
data = self.filter_data(images_path, labels_path)
|
| 50 |
cache[phase_name] = data
|
| 51 |
|
|
|
|
| 45 |
if data is None:
|
| 46 |
logger.info("Generating {} cache", phase_name)
|
| 47 |
images_path = path.join(dataset_path, "images", phase_name)
|
| 48 |
+
labels_path = path.join(dataset_path, "labels", phase_name)
|
| 49 |
data = self.filter_data(images_path, labels_path)
|
| 50 |
cache[phase_name] = data
|
| 51 |
|