Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model 9 a #2054

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions data/hyp.scratch.custom.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
lr0: 0.01 # initial learning rate (SGD=1E-2, Adam=1E-3)
lr0: 0.0001 # initial learning rate (SGD=1E-2, Adam=1E-3)
lrf: 0.1 # final OneCycleLR learning rate (lr0 * lrf)
momentum: 0.937 # SGD momentum/Adam beta1
momentum: 0.99 # SGD momentum/Adam beta1
weight_decay: 0.0005 # optimizer weight decay 5e-4
warmup_epochs: 3.0 # warmup epochs (fractions ok)
warmup_momentum: 0.8 # warmup initial momentum
Expand All @@ -24,8 +24,8 @@ shear: 0.0 # image shear (+/- deg)
perspective: 0.0 # image perspective (+/- fraction), range 0-0.001
flipud: 0.0 # image flip up-down (probability)
fliplr: 0.5 # image flip left-right (probability)
mosaic: 1.0 # image mosaic (probability)
mosaic: 0.8 # image mosaic (probability)
mixup: 0.0 # image mixup (probability)
copy_paste: 0.0 # image copy paste (probability)
paste_in: 0.0 # image copy paste (probability), use 0 for faster training
loss_ota: 1 # use ComputeLossOTA, use 0 for faster training
loss_ota: 1 # use ComputeLossOTA, use 0 for faster training
1 change: 1 addition & 0 deletions train.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

import argparse
import logging
import math
Expand Down
8 changes: 6 additions & 2 deletions utils/google_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def gsutil_getsize(url=''):
def attempt_download(file, repo='WongKinYiu/yolov7'):
# Attempt file download if does not exist
file = Path(str(file).strip().replace("'", '').lower())

if os.path.exists(file):
return # File exists, no need to download
if not file.exists():
try:
response = requests.get(f'https://api.github.com/repos/{repo}/releases/latest').json() # github api
Expand All @@ -28,7 +29,10 @@ def attempt_download(file, repo='WongKinYiu/yolov7'):
except: # fallback plan
assets = ['yolov7.pt', 'yolov7-tiny.pt', 'yolov7x.pt', 'yolov7-d6.pt', 'yolov7-e6.pt',
'yolov7-e6e.pt', 'yolov7-w6.pt']
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
try:
tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
except subprocess.CalledProcessError:
tag = 'v0.0' # default tag if git command fails

name = file.name
if name in assets:
Expand Down