If you’ve been exploring the world of image tagging and classification, you’re in for a treat! The WD 1.4 SwinV2 Tagger V2 is a powerful tool that supports ratings, characters, and general tags. Let’s take a closer look at how to set it up and start using it effectively.
Getting Started
Before you can dive into tagging images, you need to ensure you’ve set up everything correctly. Follow these steps:
- Clone the Repository: First, get the code from the GitHub repository.
- Install ONNX Runtime: Make sure you have the required version of ONNX runtime installed. You will need version 1.17.0 or higher.
- Prepare Your Dataset: The model is trained on the Danbooru images. Ensure your images have appropriate IDs and tag them correctly.
Understanding the Dataset
The model is trained on a curated dataset consisting of images filtered based on specific criteria:
- Images with IDs modulo 0000-0899 were used for training.
- Images with IDs modulo 0950-0999 were used for validation.
- Images with fewer than 10 general tags were filtered out.
- Tags associated with less than 600 images were also filtered out.
Using the Model
Now that you have the model set up and your dataset prepared, you can start using the tagging model easily. Simply use the canonical one-liner to load the model:
model = SwinV2Tagger.load()
Latest Features in Version 2.1
The new version 2.1 comes with several enhancements:
- The dataset has been re-exported to resolve an ONNX Runtime bug.
- The minimum ONNX Runtime version requirement is now bumped up to 1.17.0.
- The batch dimension of the ONNX model is now flexible, enabling batch inference.
- Compatibility with the JAX-CV codebase.
Validation Results
To give you an idea of how well the model performs, here are some key validation results:
- P=R: threshold = 0.3771
- F1 Score = 0.6854
Troubleshooting
If you face issues while using the WD 1.4 SwinV2 Tagger V2, consider these troubleshooting tips:
- Check ONNX Runtime Version: Ensure your ONNX Runtime is up to date; you need at least version 1.17.0.
- Dataset Filters: Confirm that your dataset is properly filtered according to the specifications.
- Compatibility Issues: If you encounter prediction discrepancies, it may be due to differences in implementation across frameworks.
- For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Concluding Thoughts
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

