Giter Club home page Giter Club logo

cascade-rpn's People

Contributors

ancientmooner avatar borda avatar cclauss avatar d0ng1ee avatar dhananjaisharma10 avatar dmarnerides avatar donnyyou avatar erotemic avatar gfjiangly avatar hellock avatar innerlee avatar lindahua avatar liushuchun avatar michaelisc avatar myownskyw7 avatar oceanpang avatar patrick-llgc avatar sovrasov avatar stupidzz avatar ternaus avatar thangvubk avatar wondervictor avatar wswday avatar wuyuebupt avatar xvjiarui avatar yansun1996 avatar ychfan avatar yhcao6 avatar youkaichao avatar zhihuagao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cascade-rpn's Issues

about the code env

I can't run the code, either on mmdet1.0 or mmdet2.0.
Can you talk me if I use this branch, which pytorch , mmdet and mmcv should I use?
And I find commit 6b9866 of mmdetecion framework, but with the lasted mmdetection2.1 and your commit 6b9866, I can't run the code also.

Question regarding bbox_overlaps.py

I am trying to implement Cascade RPN with the most recent mmdetection. I have a custom dataset with 4 different id for detection. After running train.py script, after the 1st epoch I am getting the following error:

" File "/home/user/Downloads/mmdetection-master/mmdet/core/evaluation/bbox_overlaps.py", line 33, in bbox_overlaps
area2 = (bboxes2[:, 2] - bboxes2[:, 0] + 1) * (
IndexError: too many indices for array
"

Is it because I am using a CustomDataset? What changes I should do to make it work for my own dataset?

I have a epoch_1.pth file generated but I am not able to get mAP chart as expected for the detection task. I am new to this project and any help with this would be appreciated .Thanks.

image

image

s0.loss_rpn_reg is 0

hi,Author, thank you for your wonderful code!but when i am training cascade_rpn, i found that s0.loss_rpn_reg was always 0 . Is that correct?
sdadadad

s0.loss_rpn_reg is always 0

Hi! I'm June.
I'm so impressed with your idea of changing RPN in 2 stage detector.
And also thanks for well-organized Cascade-RPN code.

When I followed your instruction to train Cascade-RPN based Faster R-CNN, I found something strange.
image
The problem is "s0.loss_rpn_reg is always 0".
It was same when to train only Cascade-RPN.

Is it normal to get zero of regression loss at the first rpn stage?
It would be a pleasure if you explain this phenomenon.

  • Notes
    (Training) python3 ./tools/train.py configs/cascade_rpn/cascade_rpn_r50_fpn_1x.py
    (Datasets) coco
    (Computing power) NVIDIA TITAN Xp
    (versions)
    python 3.5.2
    ubuntu 16.04
    cudnn 7.0.5
    cuda 9.0.176
    gcc 5.4.0
    nccl 2213

Welcome update to OpenMMLab 2.0

Welcome update to OpenMMLab 2.0

I am Vansin, the technical operator of OpenMMLab. In September of last year, we announced the release of OpenMMLab 2.0 at the World Artificial Intelligence Conference in Shanghai. We invite you to upgrade your algorithm library to OpenMMLab 2.0 using MMEngine, which can be used for both research and commercial purposes. If you have any questions, please feel free to join us on the OpenMMLab Discord at https://discord.gg/amFNsyUBvm or add me on WeChat (van-sin) and I will invite you to the OpenMMLab WeChat group.

Here are the OpenMMLab 2.0 repos branches:

OpenMMLab 1.0 branch OpenMMLab 2.0 branch
MMEngine 0.x
MMCV 1.x 2.x
MMDetection 0.x 、1.x、2.x 3.x
MMAction2 0.x 1.x
MMClassification 0.x 1.x
MMSegmentation 0.x 1.x
MMDetection3D 0.x 1.x
MMEditing 0.x 1.x
MMPose 0.x 1.x
MMDeploy 0.x 1.x
MMTracking 0.x 1.x
MMOCR 0.x 1.x
MMRazor 0.x 1.x
MMSelfSup 0.x 1.x
MMRotate 1.x 1.x
MMYOLO 0.x

Attention: please create a new virtual environment for OpenMMLab 2.0.

A question about the loss function

Hi,
It is mentioned in the paper that the use of anchor-free and sample discrimination in stage 1, an anchor is a positive sample if its center is inside the center region of an object.
And then, I found the classification loss function that you use at this stage is CrossEntropyLoss. I wonder why you didn't use focal loss like the other anchor-free methods. Wouldn't you encounter the problem of unbalanced positive and negative samples.
Looking forward to your reply, thank you!

s0.loss_rpn_reg is 0

According to your config at Faster RCNN, A mistake is encountered when I train Cascade RCNN. s0.loss_rpn_reg in the log information always is 0.....

image

my config is as follows:

rpn_weight = 0.7

model settings

model = dict(
type='CascadeRCNN',
num_stages=3,
num_rpn_stages=2,
pretrained="/home/tikboa/306_server_work/model_zoo/X101_dcn_backbone.pth",
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=4,
style='pytorch',
dcn=dict(
modulated=False,
groups=32,
deformable_groups=1,
fallback_on_stride=False),
stage_with_dcn=(False, True, True, True),
# gcb=dict(ratio=1. / 4., ),
# stage_with_gcb=(False, True, True, True)
),
neck=dict(
type='FPN',
in_channels=[256, 512, 1024, 2048],
out_channels=256,
num_outs=5),
rpn_head=[
dict(
type='CascadeRPNHead',
in_channels=256,
feat_channels=256,
anchor_scales=[8],
anchor_ratios=[1.0],
anchor_strides=[4, 8, 16, 32, 64],
target_means=[.0, .0, .0, .0],
target_stds=[0.1, 0.1, 0.5, 0.5],
with_cls=False,
dilation=3,
bridged_feature=True,
sampling=False,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=True,
loss_weight=rpn_weight),
loss_bbox=dict(
type='IoULoss', linear=True, loss_weight=10.0 * rpn_weight)),
dict(
type='CascadeRPNHead',
in_channels=256,
feat_channels=256,
anchor_scales=[8],
anchor_ratios=[1.0],
anchor_strides=[4, 8, 16, 32, 64],
target_means=[.0, .0, .0, .0],
target_stds=[0.05, 0.05, 0.1, 0.1],
feat_adapt=True,
loss_cls=dict(
type='CrossEntropyLoss',
use_sigmoid=True,
loss_weight=1.0 * rpn_weight),
loss_bbox=dict(
type='IoULoss', linear=True, loss_weight=10.0 * rpn_weight))],
bbox_roi_extractor=dict(
type='SingleRoIExtractor',
roi_layer=dict(type='RoIAlign', out_size=7, sample_num=2),
out_channels=256,
featmap_strides=[4, 8, 16, 32]),
bbox_head=[
dict(
type='ConvFCBBoxHead',
num_shared_convs=4,
num_shared_fcs=1,
in_channels=256,
conv_out_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=16,
target_means=[0., 0., 0., 0.],
target_stds=[0.1, 0.1, 0.2, 0.2],
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)),
dict(
type='ConvFCBBoxHead',
num_shared_convs=4,
num_shared_fcs=1,
in_channels=256,
conv_out_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=16,
target_means=[0., 0., 0., 0.],
target_stds=[0.05, 0.05, 0.1, 0.1],
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0)),
dict(
type='ConvFCBBoxHead',
num_shared_convs=4,
num_shared_fcs=1,
in_channels=256,
conv_out_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=16,
target_means=[0., 0., 0., 0.],
target_stds=[0.033, 0.033, 0.067, 0.067],
reg_class_agnostic=True,
loss_cls=dict(
type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0),
loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))
]
)

model training and testing settings

train_cfg = dict(
rpn=[
dict(
assigner=dict(
type='RegionAssigner',
center_ratio=0.2,
ignore_ratio=0.5),
allowed_border=-1,
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.7,
neg_iou_thr=0.7,
min_pos_iou=0.3,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=256,
pos_fraction=0.5,
neg_pos_ub=-1,
add_gt_as_proposals=False),
allowed_border=-1,
pos_weight=-1,
debug=False)],
rpn_proposal=dict(
nms_across_levels=False,
nms_pre=2000,
nms_post=2000,
max_num=300,
nms_thr=0.8,
min_bbox_size=0),
rcnn=[
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.3,
neg_iou_thr=0.3,
min_pos_iou=0.3,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.4,
neg_iou_thr=0.4,
min_pos_iou=0.4,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False),
dict(
assigner=dict(
type='MaxIoUAssigner',
pos_iou_thr=0.5,
neg_iou_thr=0.5,
min_pos_iou=0.5,
ignore_iof_thr=-1),
sampler=dict(
type='RandomSampler',
num=512,
pos_fraction=0.25,
neg_pos_ub=-1,
add_gt_as_proposals=True),
pos_weight=-1,
debug=False)
],
stage_loss_weights=[1, 0.5, 0.25])
test_cfg = dict(
rpn=dict(
nms_across_levels=False,
nms_pre=1000,
nms_post=1000,
max_num=300,
nms_thr=0.8,
min_bbox_size=0),
rcnn=dict(
score_thr=0.001, nms=dict(type='nms', iou_thr=0.5), max_per_img=100)
# soft-nms is also supported for rcnn testing
# e.g., nms=dict(type='soft_nms', iou_thr=0.5, min_score=0.05)
)

GIoU or CIoU loss

Thank you for your great work!
Do you try GIoU or CIoU loss in your experiments?

Cascade RPN with Cascade R-CNN

Firstly, many thanks for sharing this interest work.

I just had a very quick question on whether you were also able to see notable improvements when incorporating Cascade RPN with Cascade R-CNN, perhaps after increasing the IoU thresholds to reflect the higher quality of region proposals.

Kind regards,
Se

Which code is play the effect of restriction below Eqs 7 in Section 4.1?

In paper's section 4.1 says that:

  1. 𝑦[𝑝]=∑_(𝑜∈𝑂)▒〖𝑤[𝑜]∙𝑥[𝑝+𝑜]〗
  2. 𝑂=𝑂_𝑐𝑡𝑟+𝑂_𝑠ℎ𝑝
  3. 𝑂_𝑠ℎ𝑝={ (±(𝑎_𝑤^)/2 𝑜𝑟 0,±(𝑎_ℎ^)/2 𝑜𝑟 0)} )

I don't quite understand the operation referred to line 3. Could you please to point out what parts does it include in the code?

Error related to logger

I am pretty sure I have the environment set up as mentioned in #16 , I am getting this error though:

image

I am exploring the domain and a beginner at this. Any help would be appreciated. Thanks

Some questions about region_assigner.py

Thanks for ur wonderful work!

I try to do some extension depends on ur codes, but when i read the code, I find something strange.

Its in mmdet/core/bbox/assigner/region_assigner.py

In step 4 :Assign -1 to ignore adjacent lvl
when use calc_region function ,

d_ignore_region = calc_region(gt_bbox, d_stride, r2, d_featmap_size)
u_ignore_region = calc_region(gt_bbox, u_stride, r2, u_featmap_size)

should r2 and d_stride or u_stride change their place?

I try some example and under this code condition I get strange x,y

gt_box : tensor([473.8398, 384.1748, 804.3822, 467.8830], device='cuda:0')
d_ignore_region : x1(tensor(167., dvice='cuda:0'), y2tensor(99., device='cuda:0'), x2:tensor(0., device='cuda:0'), y2:tensor(0., device='cuda:0'))

x1 even larger than x2

but I change their place, the d_ignore_region/u_ignore_region seems normal

So I wonder if the code is something wrong, or I misunderstand someting

Thanks

s0.loss_rpn_reg < s1.loss_rpn_reg

s0.loss_rpn_reg: 0.0636, s1.loss_rpn_cls: 0.0010, s1.loss_rpn_reg: 0.2153, loss_semantic_seg: 0.9256, s0.loss_cls: 0.0855, s0.acc: 98.7988, s0.loss_bbox: 0.0004, s0.loss_mask: 0.6273, s1.loss_cls: 0.0821, s1.acc: 98.8086, s1.loss_bbox: 0.0000, s1.loss_mask: 0.3148, s2.loss_cls: 0.1494, s2.acc: 98.8086, s2.loss_bbox: 0.0000, s2.loss_mask: 0.1577, loss: 2.6227

Hi, I transfer this project to mmdetectionv2.0 version using htc, but the loss in my project shows that the s0.loss_rpn_reg << s1.loss_rpn_reg, and when I using the IOU-loss, it will report "NAN" in loss.

Excuse me, Do you know the probable reason?

Anchor-based metric with the IoU threshold of 0.7

Hi,

Thanks for your great work. I am a bit curious about how you apply anchor-based metric to sample.

Faster R-CNN sets a positive training IoU threshold and a negative IoU threshold. It keeps their numbers close to a ratio of 1:3. Since you only use one threshold, does this mean you only compute losses on those proposals with IoU higher than 0.7, and ignore others?

Best,
Jy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.