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

changes done with a running pipeline #290

Open
wants to merge 4 commits into
base: master
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
Binary file added __pycache__/test.cpython-38.pyc
Binary file not shown.
3 changes: 2 additions & 1 deletion data/val2yolo.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def wider2face(root, phase='val', ignore_small=0):
if box[2] < ignore_small or box[3] < ignore_small:
continue
box = convert((width, height), xywh2xxyy(box))
label = '0 {} {} {} {} -1 -1 -1 -1 -1 -1 -1 -1 -1 -1'.format(round(box[0], 4), round(box[1], 4),
label = '0 {} {} {} {}'.format(round(box[0], 4), round(box[1], 4),
round(box[2], 4), round(box[3], 4))
data[path].append(label)
return data
Expand All @@ -61,6 +61,7 @@ def wider2face(root, phase='val', ignore_small=0):
exit(1)

root_path = sys.argv[1]
print("print path :",os.path.join(root_path, 'val', 'label.txt'),"\n")
if not os.path.isfile(os.path.join(root_path, 'val', 'label.txt')):
print('Missing label.txt file.')
exit(1)
Expand Down
4 changes: 2 additions & 2 deletions data/widerface.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
download: bash data/scripts/get_voc.sh

# train and val data as 1) directory: path/images/, 2) file: path/images.txt, or 3) list: [path1/images/, path2/images/]
train: /ssd_1t/derron/yolov5-face/data/widerface/train # 16551 images
val: /ssd_1t/derron/yolov5-face/data/widerface/val # 16551 images
train: C:\Mantra_works\Facial\Dataset\Save\Wider_face_train # 16551 images
val: C:\Mantra_works\Facial\Dataset\Save\Wider_face_vald # 16551 images
#val: /ssd_1t/derron/yolov5-face/data/widerface/train/ # 4952 images

# number of classes
Expand Down
2 changes: 2 additions & 0 deletions download_weights.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from utils.google_utils import attempt_download
attempt_download(f'yolov5s.pt')
14 changes: 7 additions & 7 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, c1, c2, k=1, s=1, p=None, g=1, act=True): # ch_in, ch_out, k
super(Conv, self).__init__()
self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False)
self.bn = nn.BatchNorm2d(c2)
self.act = nn.SiLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
self.act = nn.LeakyReLU(0.1,inplace=True) if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
#self.act = self.act = nn.LeakyReLU(0.1, inplace=True) if act is True else (act if isinstance(act, nn.Module) else nn.Identity())

def forward(self, x):
Expand Down Expand Up @@ -127,20 +127,20 @@ def __init__(self, inp, oup, stride):
nn.BatchNorm2d(inp),
nn.Conv2d(inp, branch_features, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(branch_features),
nn.SiLU(),
nn.LeakyReLU(0.1,inplace=True),
)
else:
self.branch1 = nn.Sequential()

self.branch2 = nn.Sequential(
nn.Conv2d(inp if (self.stride > 1) else branch_features, branch_features, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(branch_features),
nn.SiLU(),
nn.LeakyReLU(0.1,inplace=True),
self.depthwise_conv(branch_features, branch_features, kernel_size=3, stride=self.stride, padding=1),
nn.BatchNorm2d(branch_features),
nn.Conv2d(branch_features, branch_features, kernel_size=1, stride=1, padding=0, bias=False),
nn.BatchNorm2d(branch_features),
nn.SiLU(),
nn.LeakyReLU(0.1,inplace=True),
)

@staticmethod
Expand Down Expand Up @@ -180,7 +180,7 @@ def __init__(self, in_channels,out_channels,mid_channels=None,stride=1):
nn.BatchNorm2d(out_channels),
)

self.relu = nn.SiLU(inplace=True)
self.relu = nn.LeakyReLU(0.1,inplace=True)

def forward(self, x):
branch1 = self.branch1(x)
Expand All @@ -202,7 +202,7 @@ def __init__(self,in_channels,out_channels,mid_channels=None,stride=1):
nn.BatchNorm2d(in_channels),
nn.Conv2d(in_channels=in_channels, out_channels=mid_channels, kernel_size=1, stride=1),
nn.BatchNorm2d(mid_channels),
nn.SiLU(inplace=True),
nn.LeakyReLU(0.1,inplace=True),
nn.Conv2d(in_channels=mid_channels, out_channels=mid_channels, kernel_size=5, stride=1,padding=2),
nn.BatchNorm2d(mid_channels),
nn.Conv2d(in_channels=mid_channels, out_channels=out_channels, kernel_size=1, stride=1),
Expand All @@ -216,7 +216,7 @@ def __init__(self,in_channels,out_channels,mid_channels=None,stride=1):
nn.BatchNorm2d(out_channels),
)

self.relu = nn.SiLU(inplace=True)
self.relu = nn.LeakyReLU(0.1,inplace=True)

def forward(self, x):
branch1 = self.branch1(x)
Expand Down
2 changes: 1 addition & 1 deletion models/yolov5s.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# parameters
nc: 1 # number of classes
depth_multiple: 0.33 # model depth multiple
depth_multiple: 1.0 # model depth multiple
width_multiple: 0.5 # layer channel multiple

# anchors
Expand Down
57 changes: 57 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
absl-py==2.1.0
cachetools==5.3.3
certifi==2024.7.4
charset-normalizer==3.3.2
colorama==0.4.6
contourpy==1.1.1
cycler==0.12.1
filelock==3.15.4
fonttools==4.53.1
fsspec==2024.6.1
google-auth==2.32.0
google-auth-oauthlib==1.0.0
grpcio==1.64.1
idna==3.7
importlib_metadata==8.0.0
importlib_resources==6.4.0
intel-openmp==2021.4.0
Jinja2==3.1.4
kiwisolver==1.4.5
Markdown==3.6
MarkupSafe==2.1.5
matplotlib==3.7.5
mkl==2021.4.0
mpmath==1.3.0
networkx==3.1
numpy==1.24.4
oauthlib==3.2.2
opencv-python==4.10.0.84
packaging==24.1
pandas==2.0.3
pillow==10.4.0
protobuf==5.27.2
pyasn1==0.6.0
pyasn1_modules==0.4.0
pyparsing==3.1.2
python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.1
requests==2.32.3
requests-oauthlib==2.0.0
rsa==4.9
scipy==1.10.1
seaborn==0.13.2
six==1.16.0
sympy==1.13.0
tbb==2021.13.0
tensorboard==2.14.0
tensorboard-data-server==0.7.2
thop==0.1.1.post2209072238
torch==2.3.1
torchvision==0.18.1
tqdm==4.66.4
typing_extensions==4.12.2
tzdata==2024.1
urllib3==2.2.2
Werkzeug==3.0.3
zipp==3.19.2
Binary file not shown.
28 changes: 28 additions & 0 deletions runs/train/exp/hyp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lr0: 0.01
lrf: 0.2
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
landmark: 0.005
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.5
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 0.5
mixup: 0.0
34 changes: 34 additions & 0 deletions runs/train/exp/opt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
weights: yolov5s.pt
cfg: models/yolov5s.yaml
data: data/widerface.yaml
hyp: data/hyp.scratch.yaml
epochs: 250
batch_size: 16
img_size:
- 800
- 800
rect: false
resume: false
nosave: false
notest: false
noautoanchor: false
evolve: false
bucket: ''
cache_images: false
image_weights: false
device: ''
multi_scale: false
single_cls: false
adam: false
sync_bn: false
local_rank: -1
log_imgs: 16
log_artifacts: false
workers: 4
project: runs/train
name: exp
exist_ok: false
total_batch_size: 16
world_size: 1
global_rank: -1
save_dir: runs\train\exp
Binary file not shown.
28 changes: 28 additions & 0 deletions runs/train/exp10/hyp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lr0: 0.01
lrf: 0.2
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
landmark: 0.005
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.5
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 0.5
mixup: 0.0
Binary file added runs/train/exp10/labels.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added runs/train/exp10/labels_correlogram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions runs/train/exp10/opt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
weights: yolov5s.pt
cfg: models/yolov5s.yaml
data: data/widerface.yaml
hyp: data/hyp.scratch.yaml
epochs: 250
batch_size: 16
img_size:
- 800
- 800
rect: false
resume: false
nosave: false
notest: false
noautoanchor: false
evolve: false
bucket: ''
cache_images: false
image_weights: false
device: ''
multi_scale: false
single_cls: false
adam: false
sync_bn: false
local_rank: -1
log_imgs: 16
log_artifacts: false
workers: 4
project: runs/train
name: exp
exist_ok: false
total_batch_size: 16
world_size: 1
global_rank: -1
save_dir: runs\train\exp10
Binary file not shown.
28 changes: 28 additions & 0 deletions runs/train/exp11/hyp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lr0: 0.01
lrf: 0.2
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
landmark: 0.005
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.5
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 0.5
mixup: 0.0
Binary file added runs/train/exp11/labels.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added runs/train/exp11/labels_correlogram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions runs/train/exp11/opt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
weights: yolov5s.pt
cfg: models/yolov5s.yaml
data: data/widerface.yaml
hyp: data/hyp.scratch.yaml
epochs: 250
batch_size: 16
img_size:
- 800
- 800
rect: false
resume: false
nosave: false
notest: false
noautoanchor: false
evolve: false
bucket: ''
cache_images: false
image_weights: false
device: ''
multi_scale: false
single_cls: false
adam: false
sync_bn: false
local_rank: -1
log_imgs: 16
log_artifacts: false
workers: 4
project: runs/train
name: exp
exist_ok: false
total_batch_size: 16
world_size: 1
global_rank: -1
save_dir: runs\train\exp11
Binary file not shown.
28 changes: 28 additions & 0 deletions runs/train/exp12/hyp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lr0: 0.01
lrf: 0.2
momentum: 0.937
weight_decay: 0.0005
warmup_epochs: 3.0
warmup_momentum: 0.8
warmup_bias_lr: 0.1
box: 0.05
cls: 0.5
landmark: 0.005
cls_pw: 1.0
obj: 1.0
obj_pw: 1.0
iou_t: 0.2
anchor_t: 4.0
fl_gamma: 0.0
hsv_h: 0.015
hsv_s: 0.7
hsv_v: 0.4
degrees: 0.0
translate: 0.1
scale: 0.5
shear: 0.5
perspective: 0.0
flipud: 0.0
fliplr: 0.5
mosaic: 0.5
mixup: 0.0
Binary file added runs/train/exp12/labels.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added runs/train/exp12/labels_correlogram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading