bubbliiiing / mobilenet-yolov4-pytorch

这是一个mobilenet-yolov4的库,把yolov4主干网络修改成了mobilenet,修改了Panet的卷积组成,使参数量大幅度缩小。
MIT License
369 stars 104 forks source link

Project dependencies may have API risk issues #44

Open PyDeps opened 1 year ago

PyDeps commented 1 year ago

Hi, In mobilenet-yolov4-pytorch, inappropriate dependency versioning constraints can cause risks.

Below are the dependencies and version constraints that the project is using

scipy==1.2.1
numpy==1.17.0
matplotlib==3.1.2
opencv_python==4.1.2.30
torch==1.2.0
torchvision==0.4.0
tqdm==4.60.0
Pillow==8.2.0
h5py==2.10.0

The version constraint == will introduce the risk of dependency conflicts because the scope of dependencies is too strict. The version constraint No Upper Bound and * will introduce the risk of the missing API Error because the latest version of the dependencies may remove some APIs.

After further analysis, in this project, The version constraint of dependency matplotlib can be changed to >=1.3.0,<=3.0.3. The version constraint of dependency tqdm can be changed to >=4.36.0,<=4.64.0. The version constraint of dependency Pillow can be changed to ==9.2.0. The version constraint of dependency Pillow can be changed to >=2.0.0,<=9.1.1.

The above modification suggestions can reduce the dependency conflicts as much as possible, and introduce the latest version as much as possible without calling Error in the projects.

The invocation of the current project includes all the following methods.

The calling methods from the matplotlib
matplotlib.use
The calling methods from the tqdm
tqdm.tqdm.set_postfix
tqdm.tqdm.close
tqdm.tqdm
tqdm.tqdm.update
The calling methods from the Pillow
PIL.Image.open
PIL.Image.fromarray
PIL.Image.new
PIL.ImageFont.truetype
The calling methods from the all methods
prec.append
self.get_random_data_with_MixUp
bounding_boxes.append
FloatTensor.view
xml.etree.ElementTree.parse.getroot
torch.distributed.barrier
torch.cuda.device_count
PIL.Image.open.save
numpy.maximum
pycocotools.cocoeval.COCOeval.evaluate
self.avg
detections.cpu.unique
matplotlib.pyplot.gca.set_ylim
self.get_target
images.append
total_xml.append
matplotlib.pyplot.gcf.tight_layout
box.split
image_id.VOCdevkit_path.os.path.join.ET.parse.getroot
already_seen_classes.append
self.model.bn1
utils.utils.cvtColor
self.writer.add_graph
batch_target.type_as.size
numpy.round
voc_ap
preprocess_gt
SpatialPyramidPooling
det_counter_per_class.keys
cv2.waitKey
matplotlib.pyplot.axis
math.ceil
torch.nn.init.orthogonal_
norm_layer
PIL.Image.open
cv2.VideoWriter_fourcc
numpy.argsort
torch.nn.Sequential
self.epoches.append
detections.cuda.cuda
input.size
batch_size.anchor_h.repeat.repeat
results.append
cv2.imwrite
x.shape.l.self.anchors_mask.len.bs.int.in_h.in_w.in_w.torch.linspace.repeat.repeat.view.type_as
matplotlib.pyplot.grid
self.SqueezeExcite.super.__init__
conv_bn
model_train.train
conv
numpy.where
loss_history.append_loss
loss_value.scaler.scale.backward
numpy.expand_dims
self.net
cv2.resize
anchors.np.array.reshape
torch.device
torch.utils.model_zoo.load_url
sigmoid
x.self.avg_pool.view
utils_bbox.DecodeBox
torch.cuda.amp.autocast
self.features.add_module
cv2.VideoCapture.release
type
image_datas.append
yolo.detect_image.save
optimizer.zero_grad
torch.nn.DataParallel
torch.nn.Identity
utils.utils.get_classes
isinstance
batch_target.type_as.type_as
os.path.normpath
y.self.fc.view
in_w.in_h.in_h.torch.linspace.repeat.t.repeat
line.split
line.os.path.basename.split
self._DenseBlock.super.__init__
y.shape.l.self.anchors_mask.len.bs.int.in_w.in_h.in_h.torch.linspace.repeat.t.repeat.view.type_as
act_layer
detections.cuda.cpu
conv_dw
self.upsample1
matplotlib.pyplot.close
net.apply
convert_annotation
optimizer.step
colorsys.hsv_to_rgb
relu
i.self.anchors_mask.len.batch_size.input_width.input_height.input_height.torch.linspace.repeat.t.repeat.view
self.norm2
self.model.layer1
input_width.input_width.torch.linspace.repeat
img_name.replace
range
self.layer2
input_width.input_height.batch_size.anchor_w.repeat.repeat.view.repeat
self.calculate_iou
load_data
in_h.in_h.torch.linspace.repeat
self.net.eval
self.layer4
int
float
torch.ones
PIL.ImageDraw.Draw.text
maxpool
results_file.write
self.box_ciou
self.DecodeBox.super.__init__
obj.find
mobilenet_v2.mobilenet_v2
model_train
loss_value.backward
self.gate_fn
layers.append
m.weight.data.normal_
batch_target.type_as.cpu
cv2.VideoCapture
annotation_line.split
anchors.np.array.reshape.split
json.dumps
numpy.random.seed
self.stage1
utils.utils_map.get_map
self.BasicBlock.super.__init__
nets.yolo_training.YOLOLoss
self.layer1
cas_iou
torch.cat
xml.etree.ElementTree.parse.findtext
pycocotools.coco.COCO.loadImgs
SELayer
xml.endswith
class_pred.float
str
in_w.in_h.self.bbox_attrs.l.self.anchors_mask.len.bs.input.view.permute.contiguous
self.down_sample2
self.net.cuda
matplotlib.pyplot.plot
self.loss_plot
torchvision.ops.nms
self.get_ignore
i.self.anchors_mask.len.batch_size.input_height.input_width.input_width.torch.linspace.repeat.repeat.view
os.makedirs
open.write
datetime.datetime.strftime
random.seed
matplotlib.pyplot.gca.set_xlim
os.walk
cv2.VideoWriter.write
self.rand
self.yolo_head2
i.j.List1.rjust
torch.pow
torch.sum
self.model.layer2
yolo.YOLO
scaled_anchors_l.torch.Tensor.index_select
self.GhostNet.super.__init__
GhostNet
torch.onnx.export
self.yolo_correct_boxes
ann.torch.from_numpy.type.append
pycocotools.coco.COCO.getCatIds
bn_function
VOCdevkit_path.os.path.join.open.read
os.path.abspath
self.stage2
self.conv_reduce
pow
_DenseLayer
top.np.floor.astype
t.batch_target.long
torch.utils.tensorboard.SummaryWriter
torch.nn.Dropout
conv_1x1_bn
t_max.result.float
in_h.in_w.in_w.torch.linspace.repeat.repeat
self.bn3
image_pred.size
self.model.conv_stem
ghostnet.to
onnx.load
torch.utils.data.distributed.DistributedSampler.set_epoch
adjust_axes
numpy.reshape
self.layer3
detection.split
input_width.input_height.self.bbox_attrs.i.self.anchors_mask.len.batch_size.input.view.permute
matplotlib.pyplot.text.get_window_extent
MobileNetV2.load_state_dict
pycocotools.cocoeval.COCOeval
model.state_dict.update
input
math.sqrt
self.bbox_util.non_max_suppression
torch.ones.type_as
image.resize.transpose
torch.nn.init.normal_
numpy.random.uniform
torch.zeros.type_as
max
cv2.VideoWriter
in_w.in_h.self.bbox_attrs.l.self.anchors_mask.len.bs.input.view.permute
densenet.load_state_dict
y_true.pred_boxes.self.box_ciou.type_as
densenet121
self.net.load_state_dict
torch.nn.functional.relu
self.bbox_util.decode_box
rec.append
torch.LongTensor.scaled_anchors_l.torch.Tensor.index_select.type_as
loss_value.item
operator.itemgetter
torch.nn.AdaptiveAvgPool2d
self.merge_bboxes
conf_thres.class_conf.image_pred.squeeze
conv_3x3_bn.append
cocoGt.imgToAnns.keys
numpy.logical_and
torch.cuda.amp.GradScaler
pycocotools.coco.COCO
cv2.split
tqdm.tqdm.update
densenet121.to
self.model.layer3
random.shuffle
pycocotools.cocoeval.COCOeval.summarize
outputs.append
sorted
self.fc.size
self.DenseNet.super.__init__
hasattr
self.YOLOLoss.super.__init__
self.val_loss.append
torch.optim.Adam.add_param_group
numpy.insert
torch.ones_like
matplotlib.pyplot.barh
self.modules
utils.utils_map.get_coco_map
matplotlib.pyplot.gcf.savefig
self.conv2
txt_file.split
glob.glob
collections.OrderedDict
input_shape.input_shape.torch.randn.to
cv2.imread
input_height.input_height.torch.linspace.repeat
ValueError
l.self.anchors_mask.index
numpy.argmin
torch.zeros_like.size
xml.etree.ElementTree.parse.iter
categories.append
torch.nn.functional.dropout
self.bn1
collections.defaultdict.keys
yolo.YOLO.get_FPS
fig.canvas.set_window_title
self.__dict__.update
input_width.input_height.self.bbox_attrs.i.self.anchors_mask.len.batch_size.input.view.permute.contiguous
torch.clamp
feature_maps.append
image.resize.resize
self.model.act1
thop.profile
self.backbone
scaler.scale
torch.log
torch.utils.data.distributed.DistributedSampler
matplotlib.pyplot.xlabel
_load_state_dict
images.cuda.cuda
self.add_module
_DenseBlock
conv2d
ResNet.load_state_dict
ResNet
m.bias.data.zero_
thop.clever_format
scaler.update
self.relu2
lr_scheduler_func
numpy.sum
numpy.max
boxes_per_image.append
resnet.resnet50
right.np.floor.astype
c.strip
tqdm.tqdm.close
cv2.getTextSize
dict
numpy.median
mAP_YOLO
self.classifier.view
self.avgpool
make_layers
fp_sorted.append
self.upsample2
scaled_anchors.FloatTensor.index_select
torch.nn.ReLU
ConvBNReLU
_make_divisible
ConvBnAct
torch.exp
self.generate
functools.partial
self.down_sample1
LongTensor
map
left.np.floor.astype
PIL.ImageDraw.Draw.textsize
onnx.save
tmp_box.append
_Transition
pg2.append
self.act1
box_a.box_a.box_a.box_a.unsqueeze.expand_as
numpy.minimum
numpy.shape
datetime.datetime.now
pattern.match.group
merge_bbox.append
l.self.anchors_mask.len.bs.int.in_h.in_w.in_w.torch.linspace.repeat.repeat.view
matplotlib.pyplot.figure
yolo.YOLO.detect_image
re.compile
self.Bottleneck.super.__init__
input_height.input_width.input_height.input_width.torch.Tensor.type
cv2.VideoCapture.get
self.classifier
torch.nn.Upsample
self.maps.append
input_height.input_width.input_width.torch.linspace.repeat.repeat
image.crop.save
self.avg_pool
b.pred_boxes.size
self._make_layer
mobilenet_v1.mobilenet_v1
os.listdir
numpy.zeros
utils.callbacks.LossHistory
self.SELayer.super.__init__
matplotlib.pyplot.gcf.set_figheight
numpy.concatenate
img_name.lower
yolo.YOLO.convert_to_onnx
label.encode.encode
pycocotools.cocoeval.COCOeval.accumulate
box_b.box_b.box_b.box_b.unsqueeze.expand_as
torchsummary.summary
input.view
self.conv_for_P3
torch.LongTensor
open.close
b.pred_boxes.view
torch.optim.AdamW
math.cos
self.conv3
error
self.model.conv1
model_train.eval
conv3x3
re.compile.match
bounding_boxes.sort
torch.hub.load_state_dict_from_url
print
make_five_conv
input_width.input_height.self.bbox_attrs.i.self.anchors_mask.len.batch_size.input.view.permute.contiguous.new
kwargs.items
cv2.cvtColor
utils.dataloader.YoloDataset
draw_plot_func
torch.nn.Conv2d
MobileNetV3
any
pg0.append
image_id.VOCdevkit_path.os.path.join.ET.parse.getroot.findall
self.model.relu
matplotlib.pyplot.imshow
t.float.float
numpy.floor
self.make_five_conv3
self.make_five_conv1
matplotlib.pyplot.title
matplotlib.pyplot.gcf.get_figheight
l.self.anchors_mask.len.bs.int.in_w.in_h.in_h.torch.linspace.repeat.t.repeat.view
utils.utils.get_anchors
input_width.input_height.input_height.torch.linspace.repeat.t.repeat
f.readline
unique_labels.cuda.cuda
in_w.in_h.bs.anchor_h.repeat.repeat.view
PIL.ImageDraw.Draw
m.weight.data.fill_
cv2.destroyAllWindows
self.model.stage2
torch.nn.functional.adaptive_avg_pool2d
matplotlib.pyplot.ylabel
torch.ones.bool
utils.cvtColor
numpy.mean
self.SpatialPyramidPooling.super.__init__
Densenet
mobilenet_v1
self._DenseLayer.super.__init__
file_lines_to_list
gt_match.split
h_sigmoid
zip
NotImplementedError
self.Upsample.super.__init__
self.model.stage1
matplotlib.pyplot.gca.get_xlim
torch.nn.SyncBatchNorm.convert_sync_batchnorm
numpy.array
torch.load
vgg
PIL.ImageDraw.Draw.rectangle
yolo_loss
torch.save
list
self.clip_by_tensor
cv2.imshow
self.global_pool
self.classifier.add_
self.YoloDataset.super.__init__
self.conv
self.blocks
self.BCELoss
PIL.Image.fromarray
obj.find.find
torch.nn.MaxPool2d
_bn_function_factory
self.fc.view
f.readlines
SqueezeExcite
layer
input_width.input_height.batch_size.anchor_h.repeat.repeat.view.repeat
dictionary.items
bboxes.extend
class_names.index
self.classifier.size
utils_map.get_coco_map
mAP_YOLO.detect_image
cv2.VideoCapture.read
VGG
matplotlib.pyplot.yticks
obj.split
random.sample
PIL.ImageFont.truetype
torch.min
ghostnet.ghostnet
VOCdevkit_path.os.path.join.open.read.strip
gt_counter_per_class.keys
torch.FloatTensor
numpy.exp
r.x.astype
anch_ious_max.view.view
str.astype
mobilenet_v2
torch.nn.ReLU6
self.ResNet.super.__init__
self.ghost2
pycocotools.coco.COCO.loadRes
mobilenet_v1.to
torch.utils.data.DataLoader
torch.nn.AvgPool2d
self.MobileNetV2.super.__init__
torch.floor
image.resize.convert
self.bn_dw
glob.glob.sort
os.path.splitext
numpy.random.shuffle
self.model.layer4
self.losses.append
pg1.append
torch.nn.init.zeros_
rec.insert
super
torch.where
class_conf.float
nets.yolo.YoloBody.load_state_dict
cv2.copyMakeBorder.copy
block
make_three_conv
utils.resize_image
ConvBNReLU.append
box_a.unsqueeze.expand
scipy.signal.savgol_filter
json.dump
yolo_head
min
self.writer.add_scalar
layers.extend
self.conv_head
name.name_box_id.append
glob.glob1
fig.canvas.get_renderer
torch.nn.BatchNorm2d
MobileNetV1
torch.mean
utils.preprocess_input
nets.yolo.YoloBody.named_modules
self.conv_expand
self.yolo_head3
self.conv_for_P4
image.size.np.floor.astype
obj.findtext
classname.find
MobileNetV3.load_state_dict
eval_callback.on_epoch_end
yolo.detect_image.append
self.bn2
self.conv_stem
nets.yolo_training.get_lr_scheduler
VOCdevkit_path.os.path.join.open.read.strip.split
tree.getroot.iter
ann.cuda
self.maxpool
self.h_swish.super.__init__
i.output.cpu
numpy.transpose.cpu
numpy.empty
onnx.checker.check_model
round
self.model.features
numpy.arange
img_name.lower.endswith
preprocess_dr
torch.atan
Upsample
prec.insert
model.backbone.parameters
matplotlib.pyplot.fill_between
cv2.copyMakeBorder
utils.utils.preprocess_input
torch.nn.init.kaiming_normal_
torch.flatten
ann.torch.from_numpy.type
open
self.features.append
x.strip
no_load_key.append
torch.optim.SGD
self.downsample
torch.nn.Linear
torchvision.models.utils.load_state_dict_from_url
VGG.load_state_dict
self.classifier.mean
matplotlib.pyplot.savefig
matplotlib.pyplot.subplots_adjust
FloatTensor
torch.unsqueeze
self.yolo_head1
self.GhostModule.super.__init__
bs.anchor_h.repeat.repeat
nets.yolo.YoloBody.state_dict
torch.randn
utils.utils.cvtColor.crop
self.input_shape.torch.zeros.to
x.add_.clamp_.div_
m.weight.size
torch.max
time.time
mobilenet_v3.mobilenet_v3
AssertionError
loss_history.writer.close
i.output.cpu.numpy
ghostnet
self.get_random_data
self.ConvBnAct.super.__init__
new_f.write
numpy.array.append
onnxsim.simplify
torch.nn.init.constant_
annotations.append
torch.nn.init.ones_
near.last_clu.all
log_average_miss_rate
self.cheap_operation
self.conv_dw
self.h_sigmoid.super.__init__
t.batch_target.torch.floor.long
cv2.merge
bottom.np.floor.astype
model_train.cuda.cuda
utils.utils_fit.fit_one_epoch
GhostModule
torch.nn.parallel.DistributedDataParallel
in_w.in_h.bs.anchor_w.repeat.repeat.view.repeat
self.make_five_conv4
numpy.min
self.make_five_conv2
y.shape.i.self.anchors_mask.len.batch_size.input_width.input_height.input_height.torch.linspace.repeat.t.repeat.view.type
cv2.VideoWriter.release
vgg.vgg
os.path.isfile
self.stage3
box_datas.append
len
torch.nn.init.xavier_normal_
format
numpy.logspace
utils.utils.download_weights
box_b.box_b.box_b.box_b.unsqueeze
math.exp
matplotlib.pyplot.gca
conv_3x3_bn
self.shortcut
sys.exit
self.ghost1
enumerate
box_a.box_a.box_a.box_a.unsqueeze
input_width.input_height.batch_size.anchor_h.repeat.repeat.view
os.path.exists
tqdm.tqdm.set_postfix
avg_iou
mobilenet_v1.to.load_state_dict
in_w.in_h.in_h.torch.linspace.repeat.t
obj_mask.type_as
self.GhostBottleneck.super.__init__
subblock
tqdm.tqdm
bs.anchor_w.repeat.repeat
torch.no_grad
self._Transition.super.__init__
r.x.np.clip.astype
torch.zeros_like.unsqueeze
numpy.random.choice
utils.utils.resize_image
self.ConvBNReLU.super.__init__
cv2.LUT
matplotlib.pyplot.margins
matplotlib.use
tp_sorted.append
torch.zeros
matplotlib.pyplot.scatter
self.InvertedResidual.super.__init__
os.path.join
os.path.basename
backbone.num_classes.anchors_mask.YoloBody.to
join
self.relu
self.model.stage3
in_w.in_h.bs.anchor_w.repeat.repeat.view
torch.linspace
torch.distributed.init_process_group
input_width.input_height.input_height.torch.linspace.repeat.t
i_list.append
norm
images.np.array.torch.from_numpy.type.append
self.fc
model.state_dict.keys
yolo.YOLO.get_map_txt
torchvision.models.utils.load_state_dict_from_url.keys
cv2.rectangle
self.VGG.super.__init__
self.SPP
self.get_map_txt
densenet
DenseNet
self.se
numpy.clip
torch.Tensor
torch.cuda.is_available
load_key.append
self.named_children
self.act2
annotation_line.split.split
numpy.random.rand
matplotlib.pyplot.text
torch.from_numpy
image_set.year.VOCdevkit_path.os.path.join.open.read.strip
image.resize.paste
matplotlib.pyplot.legend
self.primary_conv
classes.index
self.get_random_data_with_Mosaic
x.add_.clamp_
self.sigmoid
collections.defaultdict
stages.append
nets.yolo.YoloBody.train
random.sample.append
self.features
xml.etree.ElementTree.parse
matplotlib.pyplot.cla
self.YoloBody.super.__init__
self.conv1
torch.nn.ModuleList
cv2.putText
json.load
bool
torch.load.items
draw_text_in_image
f.write
matplotlib.pyplot.gcf.get_figwidth
yolo.YOLO.detect_heatmap
nets.yolo_training.set_optimizer_lr
os.getpid
setattr
printTable
image_set.year.VOCdevkit_path.os.path.join.open.read
self._initialize_weights
input_width.input_height.batch_size.anchor_w.repeat.repeat.view
h_swish
PIL.Image.new
torch.utils.checkpoint.checkpoint
tuple
numpy.uint8
self.Densenet.super.__init__
matplotlib.pyplot.gcf
yolo.detect_image.show
torch.nn.functional.relu6
self.model.maxpool
numpy.array.paste
utils.utils.show_config
box_b.unsqueeze.expand
self.EvalCallback.super.__init__
torch.optim.Adam
torch.argmax
backbone.num_classes.anchors_mask.YoloBody.to.to
DenseNet.load_state_dict
nets.yolo_training.weights_init
sub_output.cpu.numpy
torch.sigmoid.view
numpy.logical_and.split
matplotlib.pyplot.show
scaler.step
utils.callbacks.EvalCallback
conv1x1
nets.yolo.YoloBody
torch.zeros_like
in_w.in_w.torch.linspace.repeat
shutil.rmtree
utils.utils.get_lr
utils_map.get_map
MobileNetV2
batch_size.anchor_w.repeat.repeat
numpy.log
numpy.float64
image_set.year.VOCdevkit_path.os.path.join.open.read.strip.split
utils.utils_bbox.DecodeBox
self.MobileNetV1.super.__init__
torch.sigmoid
numpy.transpose
in_w.in_h.bs.anchor_h.repeat.repeat.view.repeat
t_min.t.float
kmeans
_densenet
images.np.array.torch.from_numpy.type
model.state_dict
self.upsample
x.shape.i.self.anchors_mask.len.batch_size.input_height.input_width.input_width.torch.linspace.repeat.repeat.view.type
self.MobileNetV3.super.__init__

@developer Could please help me check this issue? May I pull a request to fix it? Thank you very much.