-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- encoding: utf-8 -*- | ||
# @Author: SWHL | ||
# @Contact: [email protected] | ||
import shutil | ||
import sys | ||
from pathlib import Path | ||
|
||
cur_dir = Path(__file__).resolve().parent | ||
root_dir = cur_dir.parent | ||
|
||
sys.path.append(str(root_dir)) | ||
|
||
from label_convert.yolov5_to_yolov8 import YOLOV5ToYOLOV8 | ||
|
||
test_file_dir = cur_dir / "test_files" | ||
|
||
data_dir_name = "yolov5_dataset" | ||
|
||
|
||
def test_normal(): | ||
data_dir = test_file_dir / data_dir_name | ||
converter = YOLOV5ToYOLOV8(data_dir) | ||
converter() | ||
|
||
save_dir: Path = test_file_dir / f"{data_dir_name}_yolov8" | ||
assert save_dir.exists() | ||
|
||
train_img_dir = save_dir / "images" / "train" | ||
assert train_img_dir.exists() | ||
|
||
val_label_dir = save_dir / "labels" / "val" | ||
assert val_label_dir.exists() | ||
|
||
shutil.rmtree(save_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# -*- encoding: utf-8 -*- | ||
# @Author: SWHL | ||
# @Contact: [email protected] | ||
import shutil | ||
import sys | ||
from pathlib import Path | ||
|
||
cur_dir = Path(__file__).resolve().parent | ||
root_dir = cur_dir.parent | ||
|
||
sys.path.append(str(root_dir)) | ||
|
||
from label_convert.yolov8_to_yolov5 import YOLOV8ToYOLOV5 | ||
|
||
test_file_dir = cur_dir / "test_files" | ||
|
||
data_dir_name = "yolov8_dataset" | ||
|
||
|
||
def test_normal(): | ||
data_dir = test_file_dir / data_dir_name | ||
converter = YOLOV8ToYOLOV5(data_dir) | ||
converter() | ||
|
||
save_dir: Path = test_file_dir / f"{data_dir_name}_yolov5" | ||
assert save_dir.exists() | ||
|
||
train_img_dir = save_dir / "images" | ||
assert train_img_dir.exists() | ||
|
||
val_label_dir = save_dir / "labels" | ||
assert val_label_dir.exists() | ||
|
||
train_txt_path = save_dir / "train.txt" | ||
assert train_txt_path.exists() | ||
|
||
classes_txt_path = save_dir / "classes.txt" | ||
assert classes_txt_path.exists() | ||
|
||
shutil.rmtree(save_dir) |