From d3fb34fa91d6020f273d6d063bf324dcd97bac12 Mon Sep 17 00:00:00 2001 From: RangiLyu Date: Tue, 21 Mar 2023 16:20:54 +0800 Subject: [PATCH] bump version to 1.0.0 (#502) * bump version to 1.0.0 * yolodataset unit test --- README.md | 6 +++--- nanodet/__about__.py | 2 +- nanodet/data/dataset/yolo.py | 2 +- requirements.txt | 4 ++-- tests/data/test_img.txt | 6 ++++++ .../test_data/test_dataset/test_yolodataset.py | 17 +++++++++++++++++ 6 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 tests/data/test_img.txt create mode 100644 tests/test_data/test_dataset/test_yolodataset.py diff --git a/README.md b/README.md index ba22331d8..6b40526c1 100644 --- a/README.md +++ b/README.md @@ -141,9 +141,9 @@ Besides, We provide a notebook [here](./demo/demo-inference-with-pytorch.ipynb) ### Requirements * Linux or MacOS -* CUDA >= 10.0 -* Python >= 3.6 -* Pytorch >= 1.10 +* CUDA >= 10.2 +* Python >= 3.7 +* Pytorch >= 1.10.0, <2.0.0 ### Step diff --git a/nanodet/__about__.py b/nanodet/__about__.py index 57c1e2040..c2b088be7 100644 --- a/nanodet/__about__.py +++ b/nanodet/__about__.py @@ -1,7 +1,7 @@ import time _this_year = time.strftime("%Y") -__version__ = "1.0.0-alpha" +__version__ = "1.0.0" __author__ = "RangiLyu" __author_email__ = "lyuchqi@gmail.com" __license__ = "Apache-2.0" diff --git a/nanodet/data/dataset/yolo.py b/nanodet/data/dataset/yolo.py index 8a7baef1b..6c5efff40 100644 --- a/nanodet/data/dataset/yolo.py +++ b/nanodet/data/dataset/yolo.py @@ -64,7 +64,7 @@ def _find_image( def yolo_to_coco(self, ann_path): """ - convert xml annotations to coco_api + convert yolo annotations to coco_api :param ann_path: :return: """ diff --git a/requirements.txt b/requirements.txt index 24a86f74d..4f88e6515 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,11 +7,11 @@ onnx-simplifier opencv-python pyaml pycocotools -pytorch-lightning>=1.9.0 +pytorch-lightning>=1.9.0,<2.0.0 tabulate tensorboard termcolor -torch>=1.10 +torch>=1.10,<2.0 torchmetrics torchvision tqdm diff --git a/tests/data/test_img.txt b/tests/data/test_img.txt new file mode 100644 index 000000000..b224389b6 --- /dev/null +++ b/tests/data/test_img.txt @@ -0,0 +1,6 @@ +0 0.608987 0.354681 0.359542 0.404493 +0 0.719387 0.691062 0.037075 0.074150 +0 0.813105 0.692525 0.032876 0.038088 +0 0.865956 0.690507 0.020801 0.060458 +0 0.922998 0.677377 0.035114 0.085539 +0 0.956160 0.656642 0.021013 0.041487 diff --git a/tests/test_data/test_dataset/test_yolodataset.py b/tests/test_data/test_dataset/test_yolodataset.py new file mode 100644 index 000000000..b6b6aa6f1 --- /dev/null +++ b/tests/test_data/test_dataset/test_yolodataset.py @@ -0,0 +1,17 @@ +from nanodet.data.dataset import YoloDataset + + +def test_yolodataset(): + ann_path = "tests/data" + yolodataset = YoloDataset( + img_path=ann_path, + ann_path=ann_path, + class_names=["class1"], + input_size=[320, 320], # [w,h] + keep_ratio=False, + pipeline=dict(normalize=[[103.53, 116.28, 123.675], [57.375, 57.12, 58.395]]), + ) + assert len(yolodataset) == 1 + for i, data in enumerate(yolodataset): + assert data["img"].shape == (3, 320, 320) + assert data["gt_bboxes"].shape == (6, 4)