forked from facebookresearch/maskrcnn-benchmark
-
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.
[WIP] Add Keypoint R-CNN (facebookresearch#69)
* [WIP] Keypoints inference on C2 models work * Training seems to work Still gives slightly worse results * e2e training works but gives 3 and 5 mAP less * Add modification proposed by @ChangErgou Improves mAP by 1.5 points, to 0.514 and 0.609 * Keypoints reproduce expected results * Clean coco.py * Linter + remove unnecessary code * Merge criteria for empty bboxes in has_valid_annotation * Remove trailing print * Add demo support for keypoints Still need further cleanups and improvements, like adding fields support for the other ops in Keypoints * More cleanups and misc improvements * Fixes after rebase * Add information to the readme * Fix md formatting
- Loading branch information
Showing
28 changed files
with
1,013 additions
and
32 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://Caffe2Detectron/COCO/37697547/e2e_keypoint_rcnn_R-50-FPN_1x" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
OUT_CHANNELS: 256 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
NUM_CLASSES: 2 | ||
ROI_KEYPOINT_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "KeypointRCNNFeatureExtractor" | ||
PREDICTOR: "KeypointRCNNPredictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 56 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
KEYPOINT_ON: True | ||
DATASETS: | ||
TRAIN: ("keypoints_coco_2014_train", "keypoints_coco_2014_valminusminival",) | ||
TEST: ("keypoints_coco_2014_minival",) | ||
INPUT: | ||
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
BASE_LR: 0.02 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (60000, 80000) | ||
MAX_ITER: 90000 |
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,43 @@ | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
OUT_CHANNELS: 256 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
NUM_CLASSES: 2 | ||
ROI_KEYPOINT_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "KeypointRCNNFeatureExtractor" | ||
PREDICTOR: "KeypointRCNNPredictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 56 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
KEYPOINT_ON: True | ||
DATASETS: | ||
TRAIN: ("keypoints_coco_2014_train", "keypoints_coco_2014_valminusminival",) | ||
TEST: ("keypoints_coco_2014_minival",) | ||
INPUT: | ||
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
BASE_LR: 0.02 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (60000, 80000) | ||
MAX_ITER: 90000 |
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
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
50 changes: 50 additions & 0 deletions
50
configs/quick_schedules/e2e_keypoint_rcnn_R_50_FPN_quick.yaml
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,50 @@ | ||
MODEL: | ||
META_ARCHITECTURE: "GeneralizedRCNN" | ||
WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" | ||
BACKBONE: | ||
CONV_BODY: "R-50-FPN" | ||
OUT_CHANNELS: 256 | ||
RPN: | ||
USE_FPN: True | ||
ANCHOR_STRIDE: (4, 8, 16, 32, 64) | ||
PRE_NMS_TOP_N_TRAIN: 2000 | ||
PRE_NMS_TOP_N_TEST: 1000 | ||
POST_NMS_TOP_N_TEST: 1000 | ||
FPN_POST_NMS_TOP_N_TEST: 1000 | ||
ROI_HEADS: | ||
USE_FPN: True | ||
BATCH_SIZE_PER_IMAGE: 256 | ||
ROI_BOX_HEAD: | ||
POOLER_RESOLUTION: 7 | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
POOLER_SAMPLING_RATIO: 2 | ||
FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" | ||
PREDICTOR: "FPNPredictor" | ||
NUM_CLASSES: 2 | ||
ROI_KEYPOINT_HEAD: | ||
POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) | ||
FEATURE_EXTRACTOR: "KeypointRCNNFeatureExtractor" | ||
PREDICTOR: "KeypointRCNNPredictor" | ||
POOLER_RESOLUTION: 14 | ||
POOLER_SAMPLING_RATIO: 2 | ||
RESOLUTION: 56 | ||
SHARE_BOX_FEATURE_EXTRACTOR: False | ||
KEYPOINT_ON: True | ||
DATASETS: | ||
TRAIN: ("keypoints_coco_2014_minival",) | ||
TEST: ("keypoints_coco_2014_minival",) | ||
INPUT: | ||
MIN_SIZE_TRAIN: (640, 672, 704, 736, 768, 800) | ||
MAX_SIZE_TRAIN: 1000 | ||
MIN_SIZE_TEST: 800 | ||
MAX_SIZE_TEST: 1000 | ||
DATALOADER: | ||
SIZE_DIVISIBILITY: 32 | ||
SOLVER: | ||
BASE_LR: 0.005 | ||
WEIGHT_DECAY: 0.0001 | ||
STEPS: (1500,) | ||
MAX_ITER: 2000 | ||
IMS_PER_BATCH: 4 | ||
TEST: | ||
IMS_PER_BATCH: 2 |
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
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
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
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.