Search is not available for this dataset
image
imagewidth (px)
168
169
label
class label
3.4k classes
68Alligator's-Sword-Dragon-0-3366982
98Ambulance-Rescueroid-0-98927491
103Amphibious-Bugroth-0-40173854
152Aqua-Dragon-0-86164529
167Arcana-Knight-Joker-0-6150044
168Arcana-Knight-Joker-1-6150044
237Barbaroid,-the-Ultimate-Battle-Machine-0-54702678
286Bickuribox-0-25655502
315Black-Skull-Dragon-0-11901678
355Blue-Eyes-Ultimate-Dragon-0-23995346
356Blue-Eyes-Ultimate-Dragon-1-23995346
357Blue-Eyes-Ultimate-Dragon-2-23995346
401Brigrand-the-Glory-Dragon-0-34848821
504Charubin-the-Fire-Knight-0-37421579
507Chimera-the-Flying-Mythical-Beast-0-4796100
508Chimeratech-Overdragon-0-64599569
593Coordius-the-Triphasic-Dealmon-0-70219023
664Curse-of-Dragon,-the-Magical-Knight-Dragon-0-72064891
676Cyber-Blader-0-10248389
680Cyber-End-Dragon-0-1546123
681Cyber-End-Dragon-1-1546123
692Cyber-Ogre-2-0-37057012
697Cyber-Saurus-0-89112729
705Cyber-Twin-Dragon-0-74157028
709Cyberdark-Dragon-0-40418351
719Cyberse-Desavewurm-0-92422871
739D.3.S.-Frog-0-9910360
772Dark-Balter-the-Terrible-0-80071763
775Dark-Blade-the-Dragon-Knight-0-86805855
797Dark-Flare-Knight-0-13722870
835Dark-Paladin-0-98502113
836Dark-Paladin-1-98502113
837Dark-Paladin-2-98502113
866Darkfire-Dragon-0-17881964
891Deepsea-Shark-0-28593363
921Destiny-End-Dragoon-0-76263644
924Destiny-HERO---Dangerous-0-30757127
937Destiny-HERO---Dystopia-0-90579153
1,031Dragon-Master-Knight-0-62873545
1,036Dragoness-the-Wicked-Knight-0-70681994
1,087Elemental-HERO-Air-Neos-0-11502550
1,088Elemental-HERO-Aqua-Neos-0-55171412
1,097Elemental-HERO-Chaos-Neos-0-17032740
1,099Elemental-HERO-Dark-Neos-0-28677304
1,100Elemental-HERO-Darkbright-0-41517968
1,101Elemental-HERO-Electrum-0-29343734
1,102Elemental-HERO-Flame-Wingman-0-35809262
1,103Elemental-HERO-Flare-Neos-0-81566151
1,104Elemental-HERO-Glow-Neos-0-85507811
1,105Elemental-HERO-Grand-Neos-0-48996569
1,106Elemental-HERO-Magma-Neos-0-78512663
1,107Elemental-HERO-Marine-Neos-0-5128859
1,108Elemental-HERO-Mariner-0-14225239
1,109Elemental-HERO-Mudballman-0-52031567
1,110Elemental-HERO-Necroid-Shaman-0-81003500
1,116Elemental-HERO-Nova-Master-0-1945387
1,118Elemental-HERO-Phoenix-Enforcer-0-41436536
1,119Elemental-HERO-Plasma-Vice-0-60493189
1,121Elemental-HERO-Rampart-Blaster-0-47737087
1,122Elemental-HERO-Shining-Flare-Wingman-0-25366484
1,123Elemental-HERO-Shining-Phoenix-Enforcer-0-88820235
1,126Elemental-HERO-Steam-Healer-0-81197327
1,127Elemental-HERO-Storm-Neos-0-49352945
1,130Elemental-HERO-Tempest-0-83121692
1,131Elemental-HERO-Thunder-Giant-0-61204971
1,133Elemental-HERO-Wild-Wingman-0-55615891
1,134Elemental-HERO-Wildedge-0-10526791
1,151Empress-Judge-0-15237615
1,172Evil-HERO-Dark-Gaia-0-58332301
1,175Evil-HERO-Infernal-Sniper-0-50282757
1,176Evil-HERO-Inferno-Wing-0-22160245
1,177Evil-HERO-Lightning-Golem-0-21947653
1,179Evil-HERO-Malicious-Fiend-0-86676862
1,180Evil-HERO-Wild-Cyclone-0-13293158
1,243Fiend-Skull-Dragon-0-66235877
1,269Five-Headed-Dragon-0-99267150
1,270Five-Headed-Dragon-1-99267150
1,274Flame-Ghost-0-58528964
1,279Flame-Swordsman-0-45231177
1,280Flame-Swordsman-1-45231177
1,297Flower-Wolf-0-95952802
1,317Fossil-Dragon-Skullgios-0-21225115
1,352Fusionist-0-1641882
1,365Gaia-the-Dragon-Champion-0-66889139
1,382Gatling-Dragon-0-87751584
1,431Giltia-the-D.-Knight-0-51828629
1,445Gladiator-Beast-Gaiodiaz-0-90957527
1,446Gladiator-Beast-Gyzarus-0-48156348
1,447Gladiator-Beast-Heraklinos-0-27346636
1,539Great-Mammoth-of-Goldfine-0-54622031
1,678Humanoid-Worm-Drake-0-5600127
1,790Kaiser-Dragon-0-94566432
1,793Kaminari-Attack-0-9653271
1,797Karbonala-Warrior-0-54541900
1,805King-Dragun-0-13756293
1,833Kwagar-Hercules-0-95144193
1,837Labyrinth-Tank-0-99551425
1,929Lunalight-Panther-Dancer-0-97165977
2,029Masked-HERO-Acid-0-29095552
2,039Master-of-Oz-0-27134689

📄Documentation

Install

Both a docker installation and a more conventional installation are available. If you're not very familiar with all the code, docker installation is recommended. Otherwise, opt for the classic installation.

Docker installation

If you are familiar with docker, the docker image is available here.

Otherwise, I recommend you to download DockerDesktop if you are on Windows. If you are on Linux, you can refer to the documentation here.

Once it is done, you simply have to execute the following command,

docker run -p 5000:5000 --name draw hichtala/draw:latest

Your installation is now completed. You can press Ctrl+C and continue to Usage section.

Classic installation

You need python to be installed. Python installation isn't going to be detailed here, you can refer to the documentation.

We first need to install pytorch. It is recommended to use a package manager such as miniconda. Please refer to the documentation.

When everything is set up you can run the following command to install pytorch:

python -m pip install torch torchvision

If you want to use you gpus to make everything run faster, please refer the documentation

Then you just have to clone the repo and install requirements:

git clone https://github.com/HichTala/draw
cd draw
python -m pip install -r requirements.txt

Your installation is now completed.

Usage

Now to use it you need to download the models and the data, in section Models and Data.

Once you have it, follow instruction depending on you have docker or classic installation. Put all the model in the same folder, and keep the dataset as it is

Docker installation

You have to copy the data and models in the container. Execute the following command:

docker cp path/to/dataset/club_yugioh_dataset draw:/data
docker cp path/to/model/folder draw:/models

Once it is done you just have to run the command:

docker start draw

open the adress localhost:5000, and enjoy the maximum. Refer bellow for details about parameters

Classic installation

You need to modify the config.json file by putting the paths of you dataset folder in "data_path" parameter and the path to model folder in "trained_models" parameter.

Once done, just run:

flask --app app.py run

open the adress localhost:5000, and enjoy the maximum. Refer bellow for details about parameters

Both

  • In the first parameter, the one with gears, put the config.json file
  • In the second parameter, the one with a camera, put the video you want to process (leave it empty to use your webcam)
  • In the last one, put your deck list in the format ydk

Then you can press the button and start the process !


⚙️Models and Data

Models

In this project, the tasks were divided so that one model would locate the card and another model would classify them. Similarly, to classify the cards, I divided the task so that there is one model for each type of card, and the model to be used was determined by the color of the card.

Models can be downloaded in Hugging Face. Models starting with beit stands for classification and the one starting with yolo for localization.

Model on HF

For now only models for "retro" gameplay are available but the ones for classic format play will be added soon. I considered "retro" format all cards before the first syncro set, so all the cards edited until Light of Destruction set (LODT - 05/13/2008) set and all speed duel cards.

Data

To create a dataset, the YGOPRODeck api was used. Two datasets were thus created, one for "retro" play and the other for classic format play. Just as there is a model for each type of card, there is a dataset for each type of card.

Dataset can be downloaded in Hugging Face.

Dataset on HF

For now only "retro" dataset is available, but the one for classic format play will be added soon.


💡Inspiration

This project is inspired by content creator SuperZouloux's idea of a hologram bringing Yu-Gi-Oh! cards to life. His project uses chips inserted under the sleeves of each card, which are read by the play mat, enabling the cards to be recognized.

Inserting the chips into the sleeves is not only laborious, but also poses another problem: face-down cards are read in the same way as face-up ones. So an automatic detector is a really suitable solution.

Although this project was discouraged by KONAMI ®, the game's publisher (which is quite understandable), we can nevertheless imagine such a system being used to display the cards played during a live duel, to allow spectators to read the cards.


🔗Related Works

Although to my knowledge draw is the first detector capable of locating and detecting Yu-Gi-Oh! cards in a dueling environment, other works exist and were a source of inspiration for this project. It's worth mentioning them here.

Yu-Gi-Oh! NEURON is an official application developed by KONAMI ®. It's packed with features, including cards recognition. The application is capable of recognizing a total of 20 cards at a time, which is very decent. The drawback is that the cards must be of good quality to be recognized, which is not necessarily the case in a duel context. What's more, it can't be integrated, so the only way to use it is to use the application.

yugioh one shot learning made by vanstorm9 is a Yu-Gi-Oh! cards classification program that allow you to recognize cards. It uses siamese network to train its classification model. It gives very impressive results on images with a good quality but not that good on low quality images, and it can't localize cards.

Yolov8 is the last version of the very famous yolo family of object detector models. I think it doesn't need to be presented today, it represents state-of-the-art real time object detection model.

BEiT is a pre-trained model for image classification. It uses image transofrmers which are based on attention mechanism. It suits our problem because authors also propose a pre-trained model in Imagenet-22K. It is a dataset with 22k classes (more than most classifiers) which is interesting for our case since there is mode than 11k cards in Yu-Gi-Oh!.


🔍Method Overview

A medium blog will soon be written and published, explaining the main process from data collection to final prediction. If you have any questions, don't hesitate to open an issue.


💬Contact

You can reach me on Twitter @tiazden or by email at hich.tala.phd@gmail.com.

Downloads last month
49