動漫風格圖像的標籤預測系統。
在https://autotagger.donmai.us上嘗試一下。
或訪問https://danbooru.donmai.us/ai_tags在Danbooru上的所有帖子上瀏覽預測標籤。以下是不同標籤的一些示例:
https://danbooru.donmai.us/ai_tags?search [tag_name] = comic&search [order] = score_desc
https://danbooru.donmai.us/ai_tags?search [tag_name] = hatsune_miku&search [orderd]
https://danbooru.donmai.us/ai_tags?search [tag_name] = cat&search [order] = score_desc
# Get tags for a single image cat image.jpg | docker run --rm -i ghcr.io/danbooru/autotagger autotag - # Run the web server. Open http://localhost:5000. docker run --rm -p 5000:5000 ghcr.io/danbooru/autotagger # Get tags from the web server. curl http://localhost:5000/evaluate -X POST -F file=@hatsune_miku.jpg -F format=json
啟動應用程序服務器:
#與Dockerdocker Run -RM -P 5000:5000 GHCR.IO/Danbooru/autotagger#無dockerpython -m詩歌運行gunicorn
然後打開http:// localhost:5000用於使用WebApp。在這裡,您可以上傳圖像並查看預測標籤的列表。
如上所述啟動應用程序服務器,然後執行:
curl http:// localhost:5000/evaluate -x post -f file =@hatsune_miku.jpg -f格式= json
輸出看起來像這樣:
[ {“ filename”:“ hatsune_miku.jpg”,“標籤”:{“ 1girl”:0.99995526671409607,“ hatsune_miku”:0.999521616131210327, ,“大腿”:0.970325767993927,“ long_hair”: 0.963035569381714,“ twintails”:0.9352861046791077,“ heyte_long_hair” :0.853290200234595 eves“:0.796751081943512,“裙子”:0.7879447340965271,“評級:S”:0.7843148112297058,“ aquaa_eyes”: 0.6136178374290466,“ zettai_ryouiki”:0.5611224174499512,“ thigh_boots”:0.3745302579452515,“ _background“:0.28789788484573364,“靴子”:0.286143958568573 ,“耳機”:0.27902844548225403,“ White_background”:0.234441512882709503,“ “襯衫”:0.2172034887504578,“ fooke_at_viewer”:0.2044636756181717,“ pleated_skirt”:0.17705336213111877,“微笑” 9,“耳機”:0.16347116231918335,“站立”:0.155511766076087952,“評分:G”:0.13711321353912354, “ aqua_necktie”:0.11798079311847687,“ black_skirt”:0.11197035759687424,“ Blush”:0.10813453793525696} } 這是給出的
生成單個圖像的標籤:
#與Docker:Cat Image.jpg | docker run -rm ghcr.io/danbooru/autotagger autotag-#沒有docker:./ autotag image.jpg
生成多個圖像的標籤:
#with docker:#`-v $ pwd:/host`表示當前目錄在docker container.docker run -rm -v $ pwd:/host ghcr.io/danbooru/autotagger autotag autotag/host/host/host/host/ host/ image1.jpg/host/image2.jpg#沒有docker:./ autotag image1.jpg image2.jpg
為images/
目錄中的所有圖像生成標籤:
#與Docker:#更改圖像目錄的任何稱為toce.docker run -rm -v $ pwd/images:/images ghcr.io/danbooru/autotagger autotagg autotag/autotag/images note docker note docker:./ autotag Images/ autotag Images/
為與模式匹配的目錄中的所有文件生成標籤:
查找圖像/ -Name'*.jpg'| ./autotag -i-
以CSV格式生成標籤列表,適用於您自己的Danbooru實例:
./autotag -c -f -n images/ | gzip> tags.csv.gz
# Install system dependencies apt-get update apt-get install git build-essential gfortran libatlas-base-dev libffi-dev libssl-dev libbz2-dev liblzma-dev # Get code git clone https://github.com/danbooru/autotagger.git cd autotagger # Install Python (skip this if Python 3.9.13 is already installed) git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.10.0 echo ". $HOME/.asdf/asdf.sh" >> ~/.bashrc exec bash asdf plugin add python asdf install python 3.9.13 asdf shell python 3.9.13 # Install Python dependencies pip install poetry==1.1.13 python -m poetry env use 3.9 python -m poetry install --no-dev # Download latest model wget https://github.com/danbooru/autotagger/releases/download/2022.06.20-233624-utc/model.pth -O models/model.pth # Test that it works ./autotag test/hatsune_miku.jpg
當前的模型是庫存RESNET-152,在ImageNet上預估計,然後在Danbooru上進行了大約10個時期。
該模型在約5500個標籤上進行了培訓。這包括帶有> 750帖子的字符標籤,帶有> 2000帖子的版權標籤以及帶有> 2500帖子的一般標籤,但沒有藝術家或元標記。還包括評分。
該模型可在https://github.com/danbooru/autotagger/releases上找到。
https://github.com/kichangkim/deepdanbooru
https://github.com/smilingwolf/sw-cv-modelzoo
https://github.com/zyddnys/regdeepdanbooru
https://github.com/rezoo/illustration2vec
https://www.gwern.net/danbooru2021
https://console.cloud.google.com/storage/browser/danbooru_public/data?project=danbooru1(danbooru data umps)