ระบบทำนายแท็กสำหรับภาพอนิเมะ
ลองใช้ที่ https://autotagger.donmai.us
หรือไปที่ https://danbooru.donmai.us/ai_tags เพื่อเรียกดูแท็กที่คาดการณ์ไว้ในโพสต์ทั้งหมดบน Danbooru นี่คือตัวอย่างของแท็กที่แตกต่างกัน:
https://danbooru.donmai.us/AI_TAGS?Search [tag_name เหมือนกัน=Comic&Searchโดยสั่งซื้อ
https://danbooru.donmai.us/AI_TAGS?Search [tag_name เหมือน
https://danbooru.donmai.us/AI_TAGS?Search [tag_name เหมือน
# 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 Poetry Run Run Gunicorn
จากนั้นเปิด http: // localhost: 5000 เพื่อใช้ webapp ที่นี่คุณสามารถอัปโหลดรูปภาพและดูรายการแท็กที่คาดการณ์ไว้
เริ่มเซิร์ฟเวอร์แอพดังกล่าวข้างต้นแล้วทำ:
Curl http: // localhost: 5000/ประเมิน -x post -f file=@hatsune_miku.jpg -f format = json
ผลลัพธ์จะมีลักษณะเช่นนี้:
- {"ชื่อไฟล์": "hatsune_miku.jpg", "tags": {"1girl": 0.9995526671409607, "Hatsune_miku": 0.9995216131210327 , "thighhighs": 0.970325767993927, "long_hair":: 0.9630335569381714, "Twintails": 0.9352861046791077, "มาก _long_hair": 0.8532902002334595, "Necktie": 0.8532789945602417 Eves ": 0.796751081943512," กระโปรง ": 0.7879447340965271," คะแนน: S ": 0.7843148112297058," Aqua_eyes ": 0.6136178374290466, "zettai_ryouiki": 0.56112241744499512, "THIGH_BOOT _background ": 0.28789788484573364," รองเท้า ": 0.286143958568573," ชุดหูฟัง ": 0.27902844548225403," White_background " "เสื้อ": 0.21720334887504578, "Look_at_viewer": 0.2044636756181717, "GEALED_SKIRT": 0.1770536213111877 " , "หูฟัง": 0.16347116231918335, "ยืน": 0.15511766076087952, "อันดับ: G": 0.13711321353912354 "Aqua_necktie": 0.11798079311847687, "Black_skirt": 0.11197035759687424, "Blush": 0.1081345379352569666666 - -
สร้างแท็กสำหรับภาพเดียว:
# กับ Docker: Cat Image.jpg | Docker Run -rm ghcr.io/danbooru/autotagger autotag -# ไม่มี docker: ./ autotag image.jpg
สร้างแท็กสำหรับหลายภาพ:
# พร้อม Docker:# `-v $ pwd:/host` หมายถึงเมานต์ไดเรกทอรีปัจจุบันเป็น/โฮสต์ภายในคอนเทนเนอร์ Docker.docker Run - -rm -v $ pwd:/host ghcr.io/danbooru/autotagger autotag/host/host/ image1.jpg /host/image2.jpg# โดยไม่ต้องเทียบท่า: ./ autotag image1.jpg image2.jpg
สร้างแท็กสำหรับภาพทั้งหมดภายใน images/
ไดเรกทอรี:
# ด้วย Docker:# เปลี่ยน `images` เป็นสิ่งที่เรียกว่าไดเรกทอรีรูปภาพของคุณเรียกว่า Docker Run - -rm -v $ pwd/รูปภาพ:/images ghcr.io/danbooru/autotagger 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, pretraned บน imagenet จากนั้น finetuned บน 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/regdepdanbooru
https://github.com/rezoo/illustration2vec
https://www.gwern.net/danbooru2021
https://console.cloud.google.com/storage/browser/danbooru_public/data?project=danbooru1 (Danbooru Data Dumps)