A modular Python toolkit for building, analyzing, and visualizing fine-grained classification datasets from iNaturalist. Includes tools for web crawling, species filtering, class balancing, and manifest generation.
Project description
A modular dataset preparation toolkit for species-based classification pipelines.
A flexible and fast dataset builder for iNaturalist-style species classification.
About The Project
dataset_builder is a modular toolkit designed to streamline the process of preparing image classification datasets, especially for biodiversity and species-based research projects.
It provides flexible CLI tools and Python APIs to help you:
- Organize images by species into training and validation folders.
- Apply filtering rules based on dominant species.
- Export dataset manifests in plain text or Parquet formats.
- Handle restricted dataset creation, cross-referencing, and species-level analysis.
This package is designed with iNaturelist 2017 dataset in mind. However, it should still helps you if you want to build a similar iNaturelist-style datasets or building your own species classifier.
The project follows the DRY principle and is designed with modularity and pipeline automation in mind.
You can use the CLI to quickly build datasets, or integrate it directly into your own ML pipeline.
Built With
This package is written entirely in Python to ensure that it can run on multiple platform easily. I use the following packages to enable the high-level feature of the package.
Getting Started
This project helps you build custom fine-tuning datasets from the INaturelist collection with minimal effort. It supports tasks such as filtering species, copying matched images, generating manifests, and preparing training/validation splits - all with configurable YAML pipelines. Whether you are training a deep learning model or simply exploring biodiversity data, this toolkit gets your dataset in shape.
Prerequisites
Python >= 3.11- Git
Installation
pip install dataset_builder_inat
For more details, check out the wiki here
Usage
This package is designed to be used through its high-level Python APIs. The typical workflow is defined in a central Python script such as main.py (see below), which loads a config file and runs multiple dataset preparation stages.
Step 1: Create a YAML config file (config.yaml)
You can check out the details in the wiki here.
global:
included_classes: ["Aves", "Insecta"]
verbose: false
overwrite: false
paths:
src_dataset: "iNaturelist_2017"
dst_dataset: "haute_garonne"
web_crawl_output_json: "./output/haute_garonne.json"
output_dir: "./output"
web_crawl:
total_pages: 104
base_url: "https://www.inaturalist.org/check_lists/32961-Haute-Garonne-Check-List?page="
delay_between_requests: 1
train_val_split:
train_size: 0.8
random_state: 42
dominant_threshold: 0.9
Step 2: Create the main.py or use the dataset_orchestration.py provided in release
For more details, you can check out the wiki here
Roadmap
- Simplify
config.yamlstructure: group related options, add environmental variable support, introduce profiles (e.g., dev/prod). - Add advanced options to
train_val_split: support stratified splitting, per-class balancing, and deterministic sampling for reproducibility. - Auto-generate
config.yamlstep-by-step from terminal prompts. - Built-in summary report: after pipeline finishes, output a Markdown or HTML report: species count, splits, coverage, etc. (show logs after each run)
- Add support for export all manifests in Parquet format regardless of path format.
Contributing
Contributions are welcome!
If you have suggestions for improvements or spot any issues, feel free to open an issue or submit a pull request.
Please follow the existing project structure and naming conventions when contributing.
To get started:
- Fork the repo
- Clone your fork locally:
git clone https://github.com/HoangPham6337/iNaturelist_dataset_builder - Create a new branch:
git checkout -b feature/your-feature-name - Make your changes and commit
- Push to your fork:
git push origin feature/your-feature-name - Open a Pull Request
For major changes, please open an issue first to discuss what you’d like to change.
License
Distributed under the MIT License. See MIT License for more information.
Contact
Pham Xuan Hoang – LinkedIn – hoangphamat0407@gmail.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dataset_builder_inat-1.0.4.tar.gz.
File metadata
- Download URL: dataset_builder_inat-1.0.4.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9798740bad2ae4226b50515d4675f3e9b3a46b244fdba22c5d02f703a5348d6
|
|
| MD5 |
092605c9dabce32aeedcdee59deae8eb
|
|
| BLAKE2b-256 |
d5ecc6af71c80d0d8cc19730121054f8ff17e8474909a9403acf212be18fa595
|
File details
Details for the file dataset_builder_inat-1.0.4-py3-none-any.whl.
File metadata
- Download URL: dataset_builder_inat-1.0.4-py3-none-any.whl
- Upload date:
- Size: 43.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a544317ba0c4ac03c9c012f2ebdab96bd1141c6c8b26f9b58683ec52c35c70e
|
|
| MD5 |
a63ba9a232564edd3e682bef7d645969
|
|
| BLAKE2b-256 |
ca872e80700bb96bb8967b6b68ccadf05e62c61cfcfdcc0e1ae604ddd154b2d7
|