forked from openvinotoolkit/nncf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YOLOv4 quantization support (openvinotoolkit#662)
* added quantization of YOLOv4
- Loading branch information
Showing
4 changed files
with
108 additions
and
2 deletions.
There are no files selected for viewing
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
38 changes: 38 additions & 0 deletions
38
beta/examples/tensorflow/object_detection/configs/quantization/yolo_v4_coco_int8.json
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,38 @@ | ||
{ | ||
"model": "YOLOv4", | ||
"input_info": { | ||
"sample_size": [1, 608, 608, 3] | ||
}, | ||
|
||
"epochs": 1, | ||
"batch_size": 63, | ||
"workers": 16, | ||
|
||
"dataset": "coco/2017", | ||
"dataset_type": "tfds", | ||
|
||
"optimizer": { | ||
"type": "Adam", | ||
"schedule_type": "cosine", | ||
"schedule_params": { | ||
"base_lr": 5e-6 | ||
} | ||
}, | ||
|
||
"compression": { | ||
"algorithm": "quantization", | ||
"weights": { | ||
"per_channel": true | ||
}, | ||
"activations": { | ||
"mode": "asymmetric" | ||
}, | ||
"initializer": { | ||
"range": { | ||
"num_init_samples": 200, | ||
"type": "minmax_percentile" | ||
} | ||
} | ||
} | ||
} | ||
|
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
56 changes: 56 additions & 0 deletions
56
beta/tests/tensorflow/data/ac_configs/yolo_v4_int8_w_sym_ch_a_asym_t.yml
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,56 @@ | ||
models: | ||
- name: yolo_v4 | ||
launchers: | ||
- framework: dlsdk | ||
device: CPU | ||
adapter: | ||
type: yolo_v3 | ||
anchors: 12,16,19,36,40,28,36,75,76,55,72,146,142,110,192,243,459,401 | ||
num: 3 | ||
coords: 4 | ||
classes: 80 | ||
threshold: 0.001 | ||
anchor_masks: [[0,1,2],[3,4,5],[6,7,8]] | ||
raw_output: True | ||
outputs: | ||
- yolo_v4/nncf_wrapper_predict_conv_3/BiasAdd/Add | ||
- yolo_v4/nncf_wrapper_predict_conv_2/BiasAdd/Add | ||
- yolo_v4/nncf_wrapper_predict_conv_1/BiasAdd/Add | ||
datasets: | ||
- name: ms_coco_detection_80_class_without_background | ||
data_source: MSCOCO/val2017 | ||
annotation_conversion: | ||
converter: mscoco_detection | ||
annotation_file: MSCOCO/annotations/instances_val2017.json | ||
has_background: False | ||
sort_annotations: True | ||
use_full_label_map: False | ||
annotation: mscoco_det_80.pickle | ||
dataset_meta: mscoco_det_80.json | ||
|
||
preprocessing: | ||
- type: resize | ||
size: 608 | ||
postprocessing: | ||
- type: resize_prediction_boxes | ||
- type: filter | ||
apply_to: prediction | ||
min_confidence: 0.001 | ||
remove_filtered: true | ||
- type: nms | ||
overlap: 0.5 | ||
- type: clip_boxes | ||
apply_to: prediction | ||
metrics: | ||
- type: map | ||
integral: 11point | ||
ignore_difficult: true | ||
presenter: print_scalar | ||
- name: AP@0.5 | ||
type: coco_precision | ||
max_detections: 100 | ||
threshold: 0.5 | ||
- name: AP@0.5:0.05:0.95 | ||
type: coco_precision | ||
max_detections: 100 | ||
threshold: '0.5:0.05:0.95' |