# Pytorch InsightFace
Pretrained ResNet models from [deepinsight/insightface](https://github.com/deepinsight/insightface)
ported to pytorch.
| Model | LFW(%) | CFP-FP(%) | AgeDB-30(%) | MegaFace(%) |
| ---------- | ------ | --------- | ----------- | ------------- |
| iresnet34 | 99.65 | 92.12 | 97.70 | 96.70 |
| iresnet50 | 99.80 | 92.74 | 97.76 | 97.64 |
| iresnet100 | 99.77 | 98.27 | 98.28 | 98.47 |
## Installation
```bash
pip install git+https://github.com/nizhib/pytorch-insightface
```
## Usage
```python
import torch
from imageio import imread
from torchvision import transforms
import insightface
embedder = insightface.iresnet100(pretrained=True)
embedder.eval()
mean = [0.5] * 3
std = [0.5 * 256 / 255] * 3
preprocess = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(mean, std)
])
face = imread('resource/sample.jpg')
tensor = preprocess(face)
with torch.no_grad():
features = embedder(tensor.unsqueeze(0))[0]
print(features[:5])
```
## Recreating the weights locally
Download the original [insightface zoo](https://github.com/deepinsight/insightface/wiki/Model-Zoo) weights and place `*.params` and `*.json` files to `resource/{model}`.
Run `python scripts/convert.py` to convert and test pytorch weights.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
pytorch-insightface-mxnet2pytorch.rar (24个子文件)
pytorch-insightface-mxnet2pytorch
setup.py 1KB
requirements.txt 38B
resource
iresnet100
.gitkeep 0B
iresnet100-0000.params 215.87MB
2015211.jpg 3KB
iresnet100-symbol.json 281KB
LICENSE 1KB
insightface
__init__.py 89B
__pycache__
fresnet_insightface_jj_aug_560k.cpython-36.pyc 17KB
resnet.cpython-36.pyc 9KB
__init__.cpython-36.pyc 242B
iresnet.cpython-36.pyc 5KB
symbol_utils.cpython-36.pyc 8KB
iresnet.py 7KB
testPytorchModel.py 5KB
testMxnetModel.py 5KB
resnet.py 12KB
scripts
convert.py 4KB
README.md 1KB
.idea
misc.xml 198B
workspace.xml 9KB
pytorch-insightface-master.iml 609B
inspectionProfiles
profiles_settings.xml 174B
modules.xml 311B
共 24 条
- 1
资源评论
- 李小傑Bayes2021-08-10你好,下载了你的代码用了一下convert.py 最终在模型转换那一步是运行失败的,我尝试用我自己的方法也是有同样的问题,可以得到一个pytorch模型,但是下面这一行校验不通过: np.allclose(mx_output, th_output, atol=0.1) atol用默认值都无法通过验证,然后改成0.1同样无法通过验证,改成0.2是可以的。求指教。
邦戈栗子
- 粉丝: 126
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 航天器遥测数据故障检测系统python源码+文档说明+数据库(课程设计)
- 北京航空航天大学操作系统课设+ppt+实验报告
- 基于Vue+Echarts实现风力发电机中传感器的数据展示监控可视化系统+源代码+文档说明(高分课程设计)
- 基于单片机的风力发电机转速控制源码
- 基于C++实现的风力发电气动平衡监测系统+源代码+测量数据(高分课程设计)
- 毕业设计- 基于STM32F103C8T6 单片机,物联网技术的太阳能发电装置+源代码+文档说明+架构图+界面截图
- 基于 LSTM(长短期记忆)(即改进的循环神经网络)预测风力发电厂中风力涡轮机产生的功率+源代码+文档说明
- 基于stm32f103+空心杯电机+oled按键+运动算法
- 《CKA/CKAD应试指南/从docker到kubernetes 完全攻略》学习笔记 第1章docker基础(1.1-1.4)
- 基于python实现的水下压缩空气储能互补系统建模仿真与经济效益分析+源代码+论文
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功