Skip to content

Commit 656d75a

Browse files
committed
Updated default args to streamline use
1 parent 53582f5 commit 656d75a

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

partinet/__init__.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ def train_common_args(f):
4444
f = click.option('--resume-ckpt', type=str, default='', help='checkpoint to resume from')(f)
4545
f = click.option('--resume', is_flag=True, help='resume most recent training')(f)
4646
f = click.option('--rect', is_flag=True, help='rectangular training')(f)
47-
f = click.option('--img-size', nargs=2, type=int, default=[640, 640], help='[train, test] image sizes', show_default=True)(f)
47+
f = click.option('--img-size', nargs=2, type=int, default=[1280, 1280], help='[train, test] image sizes', show_default=True)(f)
4848
f = click.option('--batch-size', type=int, default=16, help='total batch size for all GPUs', show_default=True)(f)
4949
f = click.option('--epochs', type=int, default=300, show_default=True)(f)
5050
f = click.option('--hyp', type=click.Choice(["scratch.p5", "scratch.p6", "finetune.dynamic.adam"]), default='scratch.p5', help='hyperparameters path', show_default=True)(f)
5151
f = click.option('--data', type=str, default='data/coco.yaml', help='data.yaml path', show_default=True)(f)
5252
f = click.option('--weight', type=str, help='initial weights path', required=True)(f)
53-
f = click.option('--backbone-detector', type=click.Choice(DYNAMICDET_AVAILABLE_MODELS, case_sensitive=False), help='The choice of backbone to be used.', default="yolov7", show_default=True)(f)
53+
f = click.option('--backbone-detector', type=click.Choice(DYNAMICDET_AVAILABLE_MODELS, case_sensitive=False), help='The choice of backbone to be used.', default="yolov7-w6", show_default=True)(f)
5454

5555
return f
5656

@@ -78,7 +78,7 @@ def split(star, images, output, class_id, test_size, split_only):
7878
@click.option("--labels", type=str, required=True, help="Path to the labels directory")
7979
@click.option("--images", type=str, required=True, help="Path to the images directory")
8080
@click.option("--output", type=str, required=True, help="Path to the output STAR file")
81-
@click.option("--conf", type=float, default=0.0, help="Minimum confidence threshold from predictions")
81+
@click.option("--conf", type=float, default=0.1, help="Minimum confidence threshold from predictions")
8282
def star(labels, images, output,conf):
8383
click.echo("Generating STAR file...")
8484
import partinet.process_utils.star_file
@@ -106,7 +106,7 @@ def train():
106106
def step1(**params):
107107

108108
# dump params to terminal
109-
click.echo("Performing DynamicDet training step 1 with config:\n ", nl=False)
109+
click.echo("Performing PartiNet training step 1 with config:\n ", nl=False)
110110
params["img_size"] = list(params["img_size"])
111111
print_params(params)
112112

@@ -122,7 +122,7 @@ def step1(**params):
122122
@train_common_args
123123
def step2(**params):
124124

125-
click.echo("Performing DynamicDet training step 2 with config:\n ", nl=False)
125+
click.echo("Performing PartiNet training step 2 with config:\n ", nl=False)
126126
params["img_size"] = list(params["img_size"])
127127
print_params(params)
128128

@@ -135,13 +135,13 @@ def step2(**params):
135135
partinet.DynamicDet.train_step2.main(opt)
136136

137137
@main.command()
138-
@click.option('--backbone-detector', type=click.Choice(DYNAMICDET_AVAILABLE_MODELS, case_sensitive=False), help='The choice of backbone to be used.', default="yolov7", show_default=True)
138+
@click.option('--backbone-detector', type=click.Choice(DYNAMICDET_AVAILABLE_MODELS, case_sensitive=False), help='The choice of backbone to be used.', default="yolov7-w6", show_default=True)
139139
@click.option('--weight', type=str, help='model.pt path(s)', required=True)
140140
@click.option('--source', type=str, default='inference/images', help='source', show_default=True) # file/folder, 0 for webcam
141-
@click.option('--num-classes', type=int, default=80, help='number of classes', show_default=True)
142-
@click.option('--img-size', type=int, default=640, help='inference size (pixels)', show_default=True)
143-
@click.option('--conf-thres', type=float, default=0.25, help='object confidence threshold', show_default=True)
144-
@click.option('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS', show_default=True)
141+
@click.option('--num-classes', type=int, default=1, help='number of classes', show_default=True)
142+
@click.option('--img-size', type=int, default=1280, help='inference size (pixels)', show_default=True)
143+
@click.option('--conf-thres', type=float, default=0.0, help='object confidence threshold', show_default=True)
144+
@click.option('--iou-thres', type=float, default=0.2, help='IOU threshold for NMS', show_default=True)
145145
@click.option('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu', show_default=True)
146146
@click.option('--view-img', is_flag=True, help='display results')
147147
@click.option('--save-txt', is_flag=True, help='save results to *.txt')
@@ -162,7 +162,7 @@ def detect(**params):
162162
# "all classes"
163163
params["classes"] = params["classes"] or None
164164

165-
click.echo("Performing DynamicDet detection with config:\n ", nl=False)
165+
click.echo("Performing PartiNet particle detection with config:\n ", nl=False)
166166
print_params(params)
167167

168168
import argparse
@@ -173,13 +173,13 @@ def detect(**params):
173173
partinet.DynamicDet.detect.detect(opt)
174174

175175
@main.command()
176-
@click.option('--backbone-detector', type=click.Choice(["yolov7", "yolov7-w6", "yolov7x"], case_sensitive=False), help='The choice of backbone to be used.', default="yolov7", show_default=True)
176+
@click.option('--backbone-detector', type=click.Choice(["yolov7", "yolov7-w6", "yolov7x"], case_sensitive=False), help='The choice of backbone to be used.', default="yolov7-w6", show_default=True)
177177
@click.option('--weight', type=str, help='model.pt path(s)', required=True)
178178
@click.option('--data', type=str, default='data/coco.yaml', help='data.yaml path', show_default=True)
179179
@click.option('--batch-size', type=int, default=1, help='total batch size for all GPUs', show_default=True)
180-
@click.option('--img-size', type=int, default=640, help='validation image size (pixels)', show_default=True)
181-
@click.option('--conf-thres', type=float, default=0.001, help='object confidence threshold', show_default=True)
182-
@click.option('--iou-thres', type=float, default=0.65, help='IOU threshold for NMS', show_default=True)
180+
@click.option('--img-size', type=int, default=1280, help='validation image size (pixels)', show_default=True)
181+
@click.option('--conf-thres', type=float, default=0.3, help='object confidence threshold', show_default=True)
182+
@click.option('--iou-thres', type=float, default=0.5, help='IOU threshold for NMS', show_default=True)
183183
@click.option('--task', type=click.Choice(["train", "val", "test"]), default="test", help='train, val, test, speed or study', show_default=True)
184184
@click.option('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu', show_default=True)
185185
@click.option('--single-cls', is_flag=True, help='train multi-class data as single-class') # Might not be needed if always doing single class
@@ -197,7 +197,7 @@ def detect(**params):
197197
@click.option('--save-results', is_flag=True, help='save results')
198198
def test(**params):
199199

200-
click.echo("Performing DynamicDet test with config:\n ", nl=False)
200+
click.echo("Performing PartiNet test with config:\n ", nl=False)
201201
print_params(params)
202202

203203
import argparse

0 commit comments

Comments
 (0)