-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #636 from Nioolek/v8_seg_inference
[Feature] Support YOLOv8 Ins Segmentation Inference
- Loading branch information
Showing
7 changed files
with
661 additions
and
22 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
configs/yolov8/ins_seg/yolov8_ins_s_syncbn_fast_8xb16-500e_coco.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
_base_ = '../yolov8_s_mask-refine_syncbn_fast_8xb16-500e_coco.py' | ||
|
||
# Batch size of a single GPU during validation | ||
val_batch_size_per_gpu = 16 | ||
# Worker to pre-fetch data for each single GPU during validation | ||
val_num_workers = 8 | ||
|
||
batch_shapes_cfg = dict( | ||
_delete_=True, | ||
type='BatchShapePolicy', | ||
batch_size=val_batch_size_per_gpu, | ||
img_size=_base_.img_scale[0], | ||
# The image scale of padding should be divided by pad_size_divisor | ||
size_divisor=32, | ||
# Additional paddings for pixel scale | ||
extra_pad_ratio=0.5) | ||
|
||
# Testing take a long time due to model_test_cfg. | ||
# If you want to speed it up, you can increase score_thr | ||
# or decraese nms_pre and max_per_img | ||
model_test_cfg = dict( | ||
multi_label=True, | ||
nms_pre=30000, | ||
min_bbox_size=0, | ||
score_thr=0.001, | ||
nms=dict(type='nms', iou_threshold=0.7), | ||
max_per_img=300, | ||
mask_thr_binary=0.5, | ||
# fast_test: Whether to use fast test methods. When set | ||
# to False, the implementation here is the same as the | ||
# official, with higher mAP. If set to True, mask will first | ||
# be upsampled to origin image shape through Pytorch, and | ||
# then use mask_thr_binary to determine which pixels belong | ||
# to the object. If set to False, will first use | ||
# mask_thr_binary to determine which pixels belong to the | ||
# object , and then use opencv to upsample mask to origin | ||
# image shape. Default to False. | ||
fast_test=False) | ||
|
||
# ===============================Unmodified in most cases==================== | ||
model = dict( | ||
bbox_head=dict( | ||
type='YOLOv8InsHead', | ||
head_module=dict( | ||
type='YOLOv8InsHeadModule', masks_channels=32, | ||
protos_channels=256)), | ||
test_cfg=model_test_cfg) | ||
|
||
val_dataloader = dict( | ||
batch_size=val_batch_size_per_gpu, | ||
num_workers=val_num_workers, | ||
dataset=dict(batch_shapes_cfg=batch_shapes_cfg)) | ||
test_dataloader = val_dataloader | ||
|
||
val_evaluator = dict(metric=['bbox', 'segm']) | ||
test_evaluator = val_evaluator | ||
|
||
val_cfg = dict(type='ValLoop') | ||
test_cfg = dict(type='TestLoop') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.