Coder Social home page Coder Social logo

bobo0810 / pytorchnethub Goto Github PK

View Code? Open in Web Editor NEW
596.0 14.0 144.0 61.02 MB

项目注释+论文复现+算法竞赛+Pytorch实践

License: MIT License

Python 20.69% Jupyter Notebook 79.23% Shell 0.04% Cython 0.04%
faster-rcnn ssd yolov3 cam unet s4nd yolov4 dynamicrelu broadface hs-resnet

pytorchnethub's Introduction

linus

目的

  • 论文复现

  • 算法竞赛

  • 源码注释

    paper得来终觉浅,绝知此事要coding。

工作

支持任务: 1. 图像分类 2. 度量学习/特征对比

轻量级、模块化、高扩展、分布式、自动剪枝

Pytorch工具torch_tools、图像工具img_tools、文本工具txt_tools、列表工具list_tools

自动混合精度AMP

分布式数据并行DDP

NCNN/MNN部署

TensorRT部署

视觉任务

目标检测:Faster rcnn、YOLO v1、YOLO v3、YOLO v4、SSD、CAM、S4ND

语义分割:U-Net

主干网络:FPN、SKNet、HS-ResNet、AFF-ResNet(并入官方库)、TargetDrop

激活函数:FunnelAct、DynamicReLU

知识蒸馏:RepDistiller

人脸相关

人脸检测:Yolov5-Face 主要贡献者

人脸比对

​ 分类器:AMSoftmax|ArcFace|Circle-Loss|DiscFace|NPCFace

​ 训练策略:Semi-Siamese-Training|BroadFace

算法竞赛

雪浪制造AI挑战赛 排名: 32/2403

"计图"人工智能算法挑战赛-狗细分类 排名: 4/430

ACCV2022国际细粒度图像分析挑战赛-网络监督的细粒度识别 排名: 8/133

长期维护

自研 备注
bobotoolsGithub stars 工具库
OpenMM OpenMM系列最佳食用手册
PR 开源贡献日志
DataHub 公开数据集Hub
LearnDeepSpeed DeepSpeed教程 & 示例注释 & 学习笔记 (大模型高效训练)

时间线

2023

自研 备注 更新
LearnColossalAI ColossalAI教程 & 示例注释 & 学习笔记 (大模型高效训练) 2023.3
OpenMM OpenMM系列最佳食用手册 2023.3
PR PR开源贡献日志 2023.4
LearnDeepSpeed DeepSpeed教程 & 示例注释 & 学习笔记 (大模型高效训练) 2023.8
MiniGPT-4-DeepSpeed MiniGPT-4基于DeepSpeed加速➕ 扩充模型规模 ➕ 实验分析 2023.9

2022

官方库 更新
RepVGG(CVPR 2021) VGG再次伟大 解读+代码 2022.7
G-Ghost(IJCV 2022) 探索各级别的特征冗余 解读+代码 2022.7
BBN(CVPR2020) 双边分支网络,以解决长尾分布问题 解读+代码 2022.11
Vision Transformer(ICLR 2021) Transformer首次应用到视觉领域 解读+代码 2022.12
MAE(CVPR2021) 自监督学习 解读+代码 2022.12
自研 备注 更新
bobotoolsGithub stars 工具库 2022.2
ClassificationGithub stars 图像识别框架 2022.2
Pytorch最小实践Github stars Pytorch最小实践 2022.6
BossVision 简单、模块化、高扩展的分布式训练框架 2022.7
CUDA-Python Nvidia CUDA加速计算基础课程 2022.9
DataHub 公开数据集汇总 2022.11

2021

官方库 项目注释 备注 更新
SST(ECCV 2020) 注释 浅层人脸学习 2021.2
RepDistiller 注释 知识蒸馏算法合集 2021.2
自研 备注 更新
JittorDogsClassGithub stars “计图”算法挑战赛-狗细分类 4/430 2021.4
Yolov5-FaceGithub stars 人脸检测-支持纯TensorRT加速,成为主要贡献者 2021.12

2020

官方库 项目注释 备注 更新
DynamicReLU(ECCV 2020) 注释 动态激活函数 2020.9
AMSoftmax 注释 乘法角间隔 2020.9
ArcFace(CVPR 2019) 注释 加法角间隔 2020.9
CircleLoss(CVPR 2020) 注释 加权角间隔 2020.9
自研 备注 更新
FunnelRelu(ECCV 2020)Github stars 新型激活函数-复现 2020.7
AMP Github stars 自动混合精度-示例 2020.10
BroadFace(ECCV 2020)Github stars 人脸对比队列更新策略-复现 2020.10
TargetDropGithub stars 注意力机制Dropout-复现 2020.10
HS-ResNetGithub stars ResNet改进版-复现 2020.11
AFF-ResNet(WACV 2021)Github stars 特征融合的统一方式- 复现,并入官方库 2020.11
DDP Github stars 分布式数据并行-示例 2020.11
DiscFace(ACCV 2020)Github stars 最小差异学习-复现 2020.12
NPCFaceGithub stars 正负联合监督-复现 2020.12

2017-2019

官方库 项目注释 备注
Fatser Rcnn(NIPS 2015) 注释 目标检测
YOLO v1(CVPR 2016) 注释 目标检测
YOLO v3(ECCV 2016) 注释 重构 目标检测
YOLO v4 注释 目标检测
SSD 注释 重构 目标检测
CAM(CVPR 2016) 注释 特征可视化
U-Net(MICCAI 2015) 注释 医学影像语义分割
FPN(CVPR 2017) 注释 特征金字塔
自研 备注
XueLangTianchiGithub stars 雪浪制造AI挑战赛—视觉计算辅助良品检测 -32/2403
S4ND Github stars 单次单尺度肺结节检测(MICCAI 2018)复现
3D SKconv Github stars 注意力机制SE模块、SK模块的3D实现

注:猫狗分类、风格迁移、生成对抗等更多内容请访问pytorch-book

Star History Chart

pytorchnethub's People

Contributors

bobo0810 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pytorchnethub's Issues

Input must be >=2-d

Hello sir, when I tried to run your demo, I met several obstacles. Can you help me with the error of that? Thanks a lot

Traceback (most recent call last):
File "main.py", line 255, in
train()
File "main.py", line 102, in train
for i, (images, target) in enumerate(train_loader):
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 286, in next
return self._process_next_batch(batch)
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 307, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
ValueError: Traceback (most recent call last):
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 57, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/anaconda3/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 57, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/Downloads/project/AnnotatedNetworkModelGit/Yolov1_pytorch/data/dataset.py", line 78, in getitem
img, boxes = self.random_flip(img, boxes)
File "/home/Downloads/project/AnnotatedNetworkModelGit/Yolov1_pytorch/data/dataset.py", line 287, in random_flip
im_lr = np.fliplr(im).copy()
File "/home/anaconda3/lib/python3.6/site-packages/numpy/lib/twodim_base.py", line 82, in fliplr
raise ValueError("Input must be >= 2-d.")
ValueError: Input must be >= 2-d.

It's occured in yolov1.

请教一个YOLOv1的内容

file_root = '/home/zhuhui/data/VOCdevkit/VOC2012/JPEGImages/' #VOC2012的训练集
test_root = '/home/zhuhui/data/VOCdevkit/VOC2007/JPEGImages/' #VOC2007的测试集
train_Annotations = '/home/zhuhui/data/VOCdevkit/VOC2012/Annotations/'
voc_2007test='/home/bobo/PycharmProjects/torchProjectss/YOLOv1ByBobo/data/voc2007test.txt'
voc_2012train='/home/bobo/PycharmProjects/torchProjectss/YOLOv1ByBobo/data/voc2012train.txt'

test_img_dir='/home/bobo/PycharmProjects/torchProjectss/YOLOv1ByBobo/testImgs/a.jpg'
result_img_dir='/home/bobo/PycharmProjects/torchProjectss/YOLOv1ByBobo/testImgs/result_a.jpg'

在config.py文件中,这些是什么意思呢?好像自己的电脑也没有这些文件夹,要怎么创立使用呢?谢谢答疑

yolov1训练时loss为nan

您好,我在用yolov1的代码时候,用main.py训练,数据集合只用了VOC2007的数据,pytorch用的1.2,修改了total_loss += loss.data[0],改为total_loss += loss.item(),训练的时候loss一直是nan,别的参数没改,请问一下这是什么原因啊

对utils文件中utils.py 中的build_targets函数有一些疑问

# [16,3,13,13] 全1 然后将 负责预测物体的网格及 它周围的网格 都置为0 不参与训练 ,然后 将负责预测物体的网格再次置为1。 # 即总体**为: 负责预测物体的网格 位置置为1,它周围的网格置为0。类似NMS 非极大值抑制 conf_mask[b, best_n, gj, gi] = 1

conf_mask的意思应该是表示I_{ij}^{noobj}即表示第i 个grid cell的第j个anchor box不负责该目标,如果不负责目标,其值为1,否则其值 为0。
你的代码正好相反,如果不负责目标值为0, 否则值为1. 希望作者帮忙解决一下,看看是不是我理解错了

pytorch1.0 RuntimeError: CUDA out of memory (yolov1)

在1.0下跑,刚开始gpu就没内存了,没找到原因。
line 119, in train
loss.backward()
File "/home/dawn/anaconda3/lib/python3.7/site-packages/torch/tensor.py", line 102, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "/home/dawn/anaconda3/lib/python3.7/site-packages/torch/autograd/init.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: CUDA out of memory. Tried to allocate 23.00 MiB (GPU 0; 1.95 GiB total capacity; 1.46 GiB already allocated; 18.19 MiB free; 7.47 MiB cached)

RuntimeError

你好,我在win10上运行该程序遇到了如下报错:RuntimeError: The shape of the mask [32, 8732] at index 0 does not match the shape of the indexed tensor [279424, 1] at index 0 不知道你有什么解决办法吗。

CPU占用高,而GPU占用低

请问大佬,我用自己的数据集训练YOLO的时候CPU占用很高(100%),而GPU使用率只有10%左右,显存占用倒是有60-70%,请问是什么原因导致的呢?怎样提高GPU的使用率?

对于YOLOv3的损失函数,有一个地方不是很懂

util.py
206 conf_mask[b, anch_ious > ignore_thres] = 0 #[16,3,13,13]
220 conf_mask[b, best_n, gj, gi] = 1 #[16,3,13,13]

这两句话是在一个迭代里面的,第一个操作处理的是一个13*13的界面,这个时候会把这个界面清零,后面将负责预测物体的网格 位置置为1,它周围的网格置为0。

可是在迭代进行这个操作以后,一张图片的第二次迭代时,可能会对同一个界面进行处理啊(b不变),把第一次迭代置的1又给清楚掉

关于数据集存放的问题

您好,请问咱们这个模型的数据集是不是COCO格式的,我之前是VOC格式的。

如果是的话,我已经转换成COCO格式了,但是请问这个数据集格式应该放在哪个文件夹里面。

现在训练的时候好像没有读取我的训练集,自己也训练了,我找了好久也不知道数据集应该放在哪里。

是不是训练的图片和.json文件需要一起放到你config.py指定的samples文件夹里面。

关于训练的问题

请问为什么我改为自己的单类目标检测,训练自己标注的数据(不在coco的80类里面)
ground truth使用的是原作者最后使用的0-1的归一化xywh
结果那训练集进行检测,什么都检测不出来?是不是这里的ground truth格式不对?

交并比中为什么需要加1

def bbox_iou(box1, box2, x1y1x2y2=True):
"""
Returns the IoU of two bounding boxes
"""
if not x1y1x2y2:
# Transform from center and width to exact coordinates
b1_x1, b1_x2 = box1[:, 0] - box1[:, 2] / 2, box1[:, 0] + box1[:, 2] / 2
b1_y1, b1_y2 = box1[:, 1] - box1[:, 3] / 2, box1[:, 1] + box1[:, 3] / 2
b2_x1, b2_x2 = box2[:, 0] - box2[:, 2] / 2, box2[:, 0] + box2[:, 2] / 2
b2_y1, b2_y2 = box2[:, 1] - box2[:, 3] / 2, box2[:, 1] + box2[:, 3] / 2
else:
# Get the coordinates of bounding boxes
b1_x1, b1_y1, b1_x2, b1_y2 = box1[:,0], box1[:,1], box1[:,2], box1[:,3]
b2_x1, b2_y1, b2_x2, b2_y2 = box2[:,0], box2[:,1], box2[:,2], box2[:,3]

# get the corrdinates of the intersection rectangle
inter_rect_x1 =  torch.max(b1_x1, b2_x1)
inter_rect_y1 =  torch.max(b1_y1, b2_y1)
inter_rect_x2 =  torch.min(b1_x2, b2_x2)
inter_rect_y2 =  torch.min(b1_y2, b2_y2)
# Intersection area 这一步的加1
inter_area =    torch.clamp(inter_rect_x2 - inter_rect_x1 + 1, min=0) * \
                torch.clamp(inter_rect_y2 - inter_rect_y1 + 1, min=0)
# Union Area 这一步的加1
b1_area = (b1_x2 - b1_x1 + 1) * (b1_y2 - b1_y1 + 1)
b2_area = (b2_x2 - b2_x1 + 1) * (b2_y2 - b2_y1 + 1)

iou = inter_area / (b1_area + b2_area - inter_area + 1e-16)

return iou

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.