Sistem prediksi tag untuk gambar bergaya anime.
Cobalah di https://autotagger.donmai.us.
Atau buka https://danbooru.donmai.us/ai_tags untuk menelusuri tag yang diprediksi pada semua posting di Danbooru. Berikut adalah beberapa contoh tag yang berbeda:
https://danbooru.donmai.us/ai_tags?search[tag_nameace=comic&searchace Morder=Score_desc
https://danbooru.donmai.us/ai_tags?search[tag_nameace=hatsune_miku&searchacedaftare−=score_desc
https://danbooru.donmai.us/ai_tags?search−tag_nameace=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
Mulai server aplikasi:
# Dengan Dockerdocker Run --RM -P 5000: 5000 ghcr.io/danbooru/autotagger# Tanpa Dockerpython -M Puisi Run Gunicorn
Kemudian buka http: // localhost: 5000 untuk menggunakan Webapp. Di sini Anda dapat mengunggah gambar dan melihat daftar tag yang diprediksi.
Mulai server aplikasi seperti di atas, lalu lakukan:
Curl http: // localhost: 5000/evaluasi -x posting -f file=@hatsune_miku.jpg -f format = json
Output akan terlihat seperti ini:
[ {"nama file": "Hatsune_miku.jpg", "Tags": {"1girl": 0,999526671409607, "Hatsune_MIKU": 0,9952161278 "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" " , "Thighhighs": 0,970325767993927, "long_hair": 0.9630335569381714, "Twintails": 0.9352861046791077, ”very_long_hair": 0.8532902002334595, "det leeves ": 0,796751081943512," rok ": 0,7879447340965271," peringkat: s ": 0,7843148112297058," aqua_eyes ": 0.6136178374290466, "Zettai_ryouiki": 0,5611224174499512, "Thigh_boots": 0,374530255125515, "Black_Legwear": 0,372555125763636363636324 _Background ": 0.287897888484573364," Boots ": 0.286143958568573," headset ": 0.27902844548225403,” white_background ": 0.23441512882709503,”. "Kemeja": 0,21720334887504578, "looking_at_viewer": 0,2044636756181717, "lilin_skirt": 0.1770536177, "0.17577, "." 9, "headphone": 0,16347116231918335, "berdiri": 0,15511766076087952, "peringkat: g": 0,13711321353912354, "Aqua_necktie": 0.11798079311847687, "Black_skirt": 0.11197035759687424, "Blush": 0.10813453793525696} } ]
Menghasilkan tag untuk satu gambar:
# Dengan Docker: Cat Image.jpg | Docker Run ---RM ghcr.io/danbooru/autotagger autotag -# tanpa docker: ./ autotag image.jpg
Hasilkan tag untuk beberapa gambar:
# Dengan Docker:# `-v $ pwd:/host` berarti memasang direktori saat ini/host di dalam container docker.docker run --rm -v $ pwd:/host ghcr.io/danbooru/autotagger autotag/host/ Image1.jpg /host/image2.jpg# Tanpa Docker: ./ AutoTag Image1.jpg Image2.jpg
Hasilkan tag untuk semua gambar di dalam images/
direktori:
# With Docker:# ubah `gambar` ke apapun direktori gambar Anda disebut.docker run --rm -v $ pwd/gambar:/gambar ghcr.io/danbooru/autotagger autotag/gambar# tanpa docker:./Gambar autotag/
Hasilkan tag untuk semua file di dalam direktori yang cocok dengan pola:
Temukan gambar/ -name '*.jpg' | ./autotag -i -
Hasilkan daftar tag dalam format CSV, cocok untuk diimpor ke instance danbooru Anda sendiri:
./autotag -c -f -n gambar/ | 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
Model saat ini adalah Stock ResNet-152, pretrained di Imagenet kemudian di-finetuned di Danbooru untuk sekitar 10 zaman.
Model ini dilatih pada sekitar 5500 tag. Ini termasuk tag karakter dengan> 750 posting, tag hak cipta dengan> 2000 posting, dan tag umum dengan> 2500 posting, tetapi bukan tag artis atau meta. Peringkat juga disertakan.
Model ini tersedia di 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 (dump data Danbooru)