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

Correct YOLO yaml name, input variable in _Conv2d, and package import in boxes #218

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion configs/coco/pvt_v2_b0.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
MASK_ON: False
Expand Down
2 changes: 1 addition & 1 deletion configs/taco/darknet53.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
WEIGHTS: ""
MASK_ON: False
Expand Down
2 changes: 1 addition & 1 deletion configs/taco/r50.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
Expand Down
2 changes: 1 addition & 1 deletion configs/tl/cspdarknet.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
WEIGHTS: ""
MASK_ON: False
Expand Down
2 changes: 1 addition & 1 deletion configs/tl/darknet53.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
WEIGHTS: ""
MASK_ON: False
Expand Down
2 changes: 1 addition & 1 deletion configs/tl/r50.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
Expand Down
2 changes: 1 addition & 1 deletion configs/tl/res2net_bifpn.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
WEIGHTS: "weights/r2_50.pkl"
Expand Down
2 changes: 1 addition & 1 deletion configs/tl/res2net_fpn.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
# WEIGHTS: "weights/r2_50.pkl"
Expand Down
2 changes: 1 addition & 1 deletion configs/tl/x_s_pafpn_1gpu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
WEIGHTS: ""
MASK_ON: False
Expand Down
2 changes: 1 addition & 1 deletion configs/visdrone/r2_50_1gpu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
WEIGHTS: ""
Expand Down
2 changes: 1 addition & 1 deletion configs/voc/darknet53_1gpu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
WEIGHTS: ""
Expand Down
2 changes: 1 addition & 1 deletion configs/voc/x_s_pafpn_1gpu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
WEIGHTS: ""
MASK_ON: False
Expand Down
2 changes: 1 addition & 1 deletion configs/wearmask/r50_bifpn.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
_BASE_: "../Base-YoloV7.yaml"
_BASE_: "../Base-YOLOv7.yaml"
MODEL:
META_ARCHITECTURE: "YOLOV7"
WEIGHTS: "detectron2://ImageNetPretrained/MSRA/R-50.pkl"
Expand Down
2 changes: 1 addition & 1 deletion yolov7/modeling/backbone/layers/wrappers.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def conv2d_forward(self, input, weight):
input = F.pad(input, expanded_padding, mode='circular')

elif self.padding_mode == 'dynamic_same':
ih, iw = x.size()[-2:]
ih, iw = input.size()[-2:]
kh, kw = self.weight.size()[-2:]
sh, sw = self.stride
oh, ow = math.ceil(ih / sh), math.ceil(iw / sw)
Expand Down
18 changes: 6 additions & 12 deletions yolov7/utils/boxes.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import numpy as np

import torch
import torchvision

import torch
import torch.nn as nn
import math
import numpy as np
from enum import IntEnum, unique
from typing import List, Tuple, Union
from pycocotools import mask as coco_mask

import torch
from torch import device
from torchvision.ops.boxes import nms, box_area
import cv2
import torch.utils.data
import torchvision
from pycocotools import mask as coco_mask
import torch.nn as nn
import torch.utils.data
from torchvision.ops.boxes import box_area


_RawBoxType = Union[List[float], Tuple[float, ...], torch.Tensor, np.ndarray]

Expand Down