Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mmcv.jit #4192

Merged
merged 5 commits into from
Feb 21, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
small modify for decorator order
  • Loading branch information
limaolin committed Feb 3, 2021
commit ef8afdbc2dec915822a85e5b0e0b7a8fbc0b767f
2 changes: 1 addition & 1 deletion mmdet/models/losses/accuracy.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch.nn as nn


@mmcv.jit(derivate=True, coderize=True)
@mmcv.jit(coderize=True)
def accuracy(pred, target, topk=1, thresh=None):
"""Calculate accuracy according to the prediction and target.

Expand Down
2 changes: 1 addition & 1 deletion mmdet/models/losses/balanced_l1_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from .utils import weighted_loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def balanced_l1_loss(pred,
target,
beta=1.0,
Expand Down
2 changes: 1 addition & 1 deletion mmdet/models/losses/gaussian_focal_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from .utils import weighted_loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def gaussian_focal_loss(pred, gaussian_target, alpha=2.0, gamma=4.0):
"""`Focal Loss <https://arxiv.org/abs/1708.02002>`_ for targets in gaussian
distribution.
Expand Down
4 changes: 2 additions & 2 deletions mmdet/models/losses/gfocal_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from .utils import weighted_loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def quality_focal_loss(pred, target, beta=2.0):
r"""Quality Focal Loss (QFL) is from `Generalized Focal Loss: Learning
Qualified and Distributed Bounding Boxes for Dense Object Detection
Expand Down Expand Up @@ -51,8 +51,8 @@ def quality_focal_loss(pred, target, beta=2.0):
return loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def distribution_focal_loss(pred, label):
r"""Distribution Focal Loss (DFL) is from `Generalized Focal Loss: Learning
Qualified and Distributed Bounding Boxes for Dense Object Detection
Expand Down
10 changes: 5 additions & 5 deletions mmdet/models/losses/iou_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from .utils import weighted_loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def iou_loss(pred, target, linear=False, eps=1e-6):
"""IoU loss.

Expand All @@ -36,8 +36,8 @@ def iou_loss(pred, target, linear=False, eps=1e-6):
return loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def bounded_iou_loss(pred, target, beta=0.2, eps=1e-3):
"""BIoULoss.

Expand Down Expand Up @@ -82,8 +82,8 @@ def bounded_iou_loss(pred, target, beta=0.2, eps=1e-3):
return loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def giou_loss(pred, target, eps=1e-7):
r"""`Generalized Intersection over Union: A Metric and A Loss for Bounding
Box Regression <https://arxiv.org/abs/1902.09630>`_.
Expand All @@ -102,8 +102,8 @@ def giou_loss(pred, target, eps=1e-7):
return loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def diou_loss(pred, target, eps=1e-7):
r"""`Implementation of Distance-IoU Loss: Faster and Better
Learning for Bounding Box Regression, https://arxiv.org/abs/1911.08287`_.
Expand Down Expand Up @@ -157,8 +157,8 @@ def diou_loss(pred, target, eps=1e-7):
return loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def ciou_loss(pred, target, eps=1e-7):
r"""`Implementation of paper `Enhancing Geometric Factors into
Model Learning and Inference for Object Detection and Instance
Expand Down
4 changes: 2 additions & 2 deletions mmdet/models/losses/smooth_l1_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from .utils import weighted_loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def smooth_l1_loss(pred, target, beta=1.0):
"""Smooth L1 loss.

Expand All @@ -28,8 +28,8 @@ def smooth_l1_loss(pred, target, beta=1.0):
return loss


@weighted_loss
@mmcv.jit(derivate=True, coderize=True)
@weighted_loss
def l1_loss(pred, target):
"""L1 loss.

Expand Down