Comments (3)
Hi, I haven't yet played YOLOv5 with Varifocal Loss. I think you may try the methods below to see if you can achieve some improvements.
- Try different values of
gamma
andalpha
. - Predict the IACS (as the final detection score) instead of the classification score with Varifocal Loss. Please refer to our paper for what is the IACS.
from varifocalnet.
Did you solve it?
from varifocalnet.
Hello I tried to implement this in YOLOv5 but why do I get an error saying "AttributeError: 'Model' object has no attribute 'reduction'" Help me pleaseee thank youu
the FocalLoss there is actually a VFocalLoss, I just named it focal loss.
hi,i test VFocalLoss in yolov5,but not getting improvment. did you have done some test about yolov5 ? or any suggestion ? thank your ~
class VFocalLoss(nn.Module):
def __init__(self, loss_fcn, gamma=2.0, alpha=0.75): #runs/train/exp28 super(VFocalLoss, self).__init__() # 传递 nn.BCEWithLogitsLoss() 损失函数 must be nn.BCEWithLogitsLoss() self.loss_fcn = loss_fcn # self.gamma = gamma self.alpha = alpha self.reduction = loss_fcn.reduction self.loss_fcn.reduction = 'mean' # required to apply VFL to each element def forward(self, pred, true): loss = self.loss_fcn(pred, true) pred_prob = torch.sigmoid(pred) # prob from logits focal_weight = true * (true > 0.0).float() + self.alpha * (pred_prob - true).abs().pow(self.gamma) * (true <= 0.0).float() loss *= focal_weight if self.reduction == 'mean': return loss.mean() elif self.reduction == 'sum': return loss.sum() else: return loss
from varifocalnet.
Related Issues (20)
- Some question about the inference HOT 4
- VFNet-X's config file 404 error HOT 2
- Do you think the `VarifocalLoss` could be used for labels with value of 0 & 1 ? HOT 2
- How to visualize detection results?
- where is Star-Shaped Box Feature Representation and Bounding Box Refinement in the code HOT 2
- GPU error HOT 3
- KeyError: 'ATSSVGFLHead is not in the head registry' HOT 9
- How to reimplement IACS? HOT 2
- Varifocal Loss for YOLOv5 HOT 2
- Using MMDet version of VFNet with the lastest backbone (e,g. Poolformer S36, ConvNeXt Small) with Inf Issues on Varifocal loss HOT 1
- VarifocalLoss HOT 1
- Can varifocal loss be applied to softmax classifier?
- AttributeError:'ConfigDict' object has no attribute 'test_cfg'
- Question about `detach` HOT 7
- About applying Varfifocal to yolox objectness loss HOT 2
- cls loss is increasing HOT 4
- Train custom dataset HOT 2
- Welcome update to OpenMMLab 2.0
- Architecture dimension
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 varifocalnet.