new check_dataset functions (#43)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Ayush Chaurasia 2022-11-12 19:32:41 +05:30 committed by GitHub
parent d143ac666f
commit 1f3aad86c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 336 additions and 62 deletions

View file

@ -118,9 +118,3 @@ def get_model(model='s.pt', pretrained=True):
return torchvision.models.__dict__[model](weights='IMAGENET1K_V1' if pretrained else None)
else: # Ultralytics assets
return torch.load(attempt_download(f"{model}.pt"), map_location='cpu')
def yaml_load(file='data.yaml'):
# Single-line safe yaml loading
with open(file, errors='ignore') as f:
return yaml.safe_load(f)