Comments (6)
Hi, @PressEtoRace . Following the trend of anchor-free models, s2anet
uses one anchor per location in the feature maps, which saves computations and runs faster. So we haven't implemented multiple anchors learning. But it is not impossible to train s2anet
with multiple anchors. Some methods in s2anet_head should be modified:
_init_layers
,forward_single
. You need add multiple anchors likeRetinaNet
. Also, modifyanchor generation
method andbbox_decode
method for a batch of anchors. Besides, modifyanchor2offset
inAlignConv
so that multiple anchors in per location can get multipleoffset
(see here).loss
andget_refine_anchors
. Modifyget_refine_anchors
,loss_fam_single
andloss_odm_single
.get_bboxes
.
Take Retinanet
as a reference, it will be not hard if you fully understand our paper and mmdetection.
from s2anet.
Have you implemented multiple scales? @PressEtoRace , Can you share me the model after change? Thank you very much! My e-mail is [email protected]
from s2anet.
i just modified the AlignConv to support multi scale and multi ratio anchor setting, it seems to work
def forward(self, x, anchors, stride):
out = list()
for i in range(self.anchor_num):
offset = anchor2offset(anchors[..., i * 5: (i+1) * 5], self.kernel_size, stride)
out.append(self.relu(self.deform_conv(x, offset)))
# TODO: max-pooling over multi anchor to get feature
out = torch.stack(out, dim=1)
out, _ = torch.max(out, dim=1, keepdim=False)
return out
and modified the _init_layers
self.fam_reg = nn.Conv2d(self.feat_channels, self.num_anchors * 5, 1)
self.fam_cls = nn.Conv2d(self.feat_channels, self.num_anchors * self.cls_out_channels, 1)
self.odm_cls = nn.Conv2d(self.feat_channels, self.num_anchors * self.cls_out_channels, 3, padding=1)
self.odm_reg = nn.Conv2d(self.feat_channels, self.num_anchors * 5, 3, padding=1)
from s2anet.
i just modified the AlignConv to support multi scale and multi ratio anchor setting, it seems to work
def forward(self, x, anchors, stride): out = list() for i in range(self.anchor_num): offset = anchor2offset(anchors[..., i * 5: (i+1) * 5], self.kernel_size, stride) out.append(self.relu(self.deform_conv(x, offset))) # TODO: max-pooling over multi anchor to get feature out = torch.stack(out, dim=1) out, _ = torch.max(out, dim=1, keepdim=False) return out
and modified the
_init_layers
self.fam_reg = nn.Conv2d(self.feat_channels, self.num_anchors * 5, 1) self.fam_cls = nn.Conv2d(self.feat_channels, self.num_anchors * self.cls_out_channels, 1) self.odm_cls = nn.Conv2d(self.feat_channels, self.num_anchors * self.cls_out_channels, 3, padding=1) self.odm_reg = nn.Conv2d(self.feat_channels, self.num_anchors * 5, 3, padding=1)
Hi I want to know How to set self.anchor_num
from s2anet.
@LoveDLWujing
Hi,I followed the code you posted with no success. Could you please post all the changed code?
from s2anet.
@PressEtoRace @vision-zhu @taoboyang
Use multiple anchors to train, have you implemented it successfully? Can you share me the model after change? Thank you very much!
from s2anet.
Related Issues (20)
- RuntimeError: expected device cuda:1 but got device cuda:0 HOT 2
- 请问一下数据预处理生成的trainval_s2anet.pkl和test_s2anet.pkl包含的是哪些内容? HOT 1
- 关于更换backbone之后mAP输出始终为0 HOT 1
- 计算旋转IOU时的数据格式
- 新手求救! HOT 2
- IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed
- 关于初始学习率的设置
- ModuleNotFoundError: No module named 'DOTA_devkit'
- 请问在训练后如何生成pickle类型的文件呢,谢谢您 HOT 1
- ImportError: cannot import name 'ConvModule' from 'mmcv.cnn'
- Welcome update to OpenMMLab 2.0
- Why use train and validation datasets both for training?
- 关于ARF算子
- Experimental effect
- setup.py HOT 3
- python setup.py develop报错
- Prepare datasets
- Prepare datasets
- python tools/train.py configs/dota/s2anet_r50_fpn_1x_dota.py
- 执行python tools/test.py,生成results_after_nms后,进行Start evaluation,报错文件找不到!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from s2anet.