Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
taoming committed Jan 22, 2022
1 parent 11d0098 commit 997f2c4
Show file tree
Hide file tree
Showing 13 changed files with 25,042 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

imgs/
out/
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 自拍筛选工具
基于深度学习颜值评分进行自拍照片筛选,灵感来源:看到[@小众软件 转发的 @睡到人间吃饭时 的微博](https://weibo.com/1684197391/Lb0ggA0rK?type=comment)

## 原理
使用ResNet18模型对文件夹中的每张照片进行评分,排序后将分数最高的n张复制到目标文件夹中。

模型来源:[CharlesPikachu/isBeauty](https://github.com/CharlesPikachu/isBeauty)

部署工具:使用[pnnx](https://github.com/pnnx/pnnx)将PyTorch模型转为[ncnn](https://github.com/Tencent/ncnn)

若对模型效果不满意,可以自行训练替换`models`目录下的模型,或对配置文件`config.ini``model`项的路径进行修改。

## 使用方法
1. 从源代码运行
首先安装好需要的包
```bash
$ pip install -r requirements.txt
```
随后使用python运行`photo_filter.py`
```bash
$ python photo_filter.py
```

2. 使用编译好的程序(Windows)
下载[photo_filter_windows_x64.zip](),解压后双击`photo_filter.exe`运行。

## 使用效果
![example](./gif/example.gif)


The emoji graphics are from the open source project [Twemoji](https://twemoji.twitter.com/). The graphics are copyright 2020 Twitter, Inc and other contributors. The graphics are licensed under [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/). You should review the license before usage in your project.
7 changes: 7 additions & 0 deletions config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[model]
bin=models/model.ncnn.bin
param=models/model.ncnn.param

[path]
output_path=/home/tommy/code/photo_filter/out
pic_path=/home/tommy/code/photo_filter/imgs
Loading

0 comments on commit 997f2c4

Please sign in to comment.