Skip to content

Commit

Permalink
Upgrade the default setting to r6.0 (#213)
Browse files Browse the repository at this point in the history
* Upgrade the default setting of yolort.models to r6.0

* Revert setting about testing coco evaluator
  • Loading branch information
zhiqwang authored Oct 25, 2021
1 parent ba00436 commit c5efc77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions test/test_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_vanilla_coco_evaluator():
coco = data_helper.get_coco_api_from_dataset(val_dataloader.dataset)
coco_evaluator = COCOEvaluator(coco)
# Load model
model = yolov5s(pretrained=True)
model = yolov5s(upstream_version="r4.0", pretrained=True)
model.eval()
for images, targets in val_dataloader:
preds = model(images)
Expand All @@ -116,7 +116,7 @@ def test_test_epoch_end():
val_dataloader = data_helper.get_dataloader(data_root=data_path, mode="val")

# Load model
model = yolov5s(pretrained=True, annotation_path=annotation_file)
model = yolov5s(upstream_version="r4.0", pretrained=True, annotation_path=annotation_file)

# test step
trainer = pl.Trainer(max_epochs=1)
Expand Down
12 changes: 6 additions & 6 deletions yolort/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def yolov5n(upstream_version: str = "r6.0", export_friendly: bool = False, **kwa
return model


def yolov5s(upstream_version: str = "r4.0", export_friendly: bool = False, **kwargs: Any):
def yolov5s(upstream_version: str = "r6.0", export_friendly: bool = False, **kwargs: Any):
"""
Args:
upstream_version (str): model released by the upstream YOLOv5. Possible values
are ["r3.1", "r4.0", "r6.0"]. Default: "r4.0".
are ["r3.1", "r4.0", "r6.0"]. Default: "r6.0".
export_friendly (bool): Deciding whether to use (ONNX/TVM) export friendly mode.
Default: False.
"""
Expand All @@ -64,11 +64,11 @@ def yolov5s(upstream_version: str = "r4.0", export_friendly: bool = False, **kwa
return model


def yolov5m(upstream_version: str = "r4.0", export_friendly: bool = False, **kwargs: Any):
def yolov5m(upstream_version: str = "r6.0", export_friendly: bool = False, **kwargs: Any):
"""
Args:
upstream_version (str): model released by the upstream YOLOv5. Possible values
are ["r3.1", "r4.0", "r6.0"]. Default: "r4.0".
are ["r3.1", "r4.0", "r6.0"]. Default: "r6.0".
export_friendly (bool): Deciding whether to use (ONNX/TVM) export friendly mode.
Default: False.
"""
Expand All @@ -87,11 +87,11 @@ def yolov5m(upstream_version: str = "r4.0", export_friendly: bool = False, **kwa
return model


def yolov5l(upstream_version: str = "r4.0", export_friendly: bool = False, **kwargs: Any):
def yolov5l(upstream_version: str = "r6.0", export_friendly: bool = False, **kwargs: Any):
"""
Args:
upstream_version (str): model released by the upstream YOLOv5. Possible values
are ["r3.1", "r4.0", "r6.0"]. Default: "r4.0".
are ["r3.1", "r4.0", "r6.0"]. Default: "r6.0".
export_friendly (bool): Deciding whether to use (ONNX/TVM) export friendly mode.
Default: False.
"""
Expand Down

0 comments on commit c5efc77

Please sign in to comment.