-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix coco dataset training support (#174)
* fix training from coco * add tests for training from coco * add test data.yaml for cooc training * fix ci * update version
- Loading branch information
Showing
5 changed files
with
45 additions
and
3 deletions.
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,4 @@ | ||
train_json_path: "tests/data/dataset.json" | ||
train_image_dir: "tests/data/images/" | ||
val_json_path: "tests/data/dataset.json" | ||
val_image_dir: "tests/data/images/" |
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 @@ | ||
import os | ||
from pathlib import Path | ||
|
||
import urllib.request | ||
|
||
TEST_COCO_DATASET_URL = "https://github.com/fcakyon/yolov5-pip/releases/download/0.6/test-coco-dataset.zip" | ||
TEST_COCO_DATASET_ZIP_PATH = "tests/data/test-coco-dataset.zip" | ||
|
||
|
||
def download_from_url(from_url: str, to_path: str): | ||
|
||
Path(to_path).parent.mkdir(parents=True, exist_ok=True) | ||
|
||
if not os.path.exists(to_path): | ||
urllib.request.urlretrieve( | ||
from_url, | ||
to_path, | ||
) | ||
|
||
def download_test_coco_dataset_and_unzip(): | ||
if not os.path.exists(TEST_COCO_DATASET_ZIP_PATH): | ||
print("Downloading test coco dataset...") | ||
download_from_url(TEST_COCO_DATASET_URL, TEST_COCO_DATASET_ZIP_PATH) | ||
print("Download complete.") | ||
|
||
if not os.path.exists("tests/data/dataset.json"): | ||
print("Unzipping test coco dataset...") | ||
import zipfile | ||
with zipfile.ZipFile(TEST_COCO_DATASET_ZIP_PATH, "r") as zip_ref: | ||
zip_ref.extractall("tests/data") | ||
print("Unzip complete.") | ||
|
||
if __name__ == "__main__": | ||
download_test_coco_dataset_and_unzip() |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from yolov5.helpers import YOLOv5 | ||
from yolov5.helpers import load_model as load | ||
|
||
__version__ = "7.0.1" | ||
__version__ = "7.0.2" |
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