File size: 6,229 Bytes
6c4b0db
 
 
 
 
 
 
 
 
 
 
 
 
 
4dfe912
6c4b0db
 
 
 
 
7ccab00
6c4b0db
7ccab00
 
 
6c4b0db
7ccab00
6c4b0db
7ccab00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
license: other
task_categories:
- image-classification
- zero-shot-image-classification
- text-to-image
language:
- en
- ja
tags:
- art
- anime
- not-for-all-audiences
size_categories:
- 1M<n<10M
annotations_creators:
- no-annotation
source_datasets:
- danbooru
---
# 🎨 Danbooru2024 Dataset

![Dataset Size](https://img.shields.io/badge/Images-6.5M-blue)
![Language](https://img.shields.io/badge/Languages-EN%20|%20JA-green)
![Category](https://img.shields.io/badge/Category-Image%20Classification-orange)

## 📊 Dataset Overview

The **Danbooru2024** dataset is a comprehensive collection focused on animation and illustration artwork, derived from the official Danbooru platform. It contains approximately **6.5 million high-quality, user-annotated images** with corresponding tags and textual descriptions.

This dataset is filtered from an original set of **8.3 million entries**, excluding NSFW-rated, **opt-out** entries to create a more accessible and audience-friendly resource. It addresses the challenges associated with overly crawled booru databases by providing a curated and well-structured solution.

## ✨ Features

### 📋 Metadata Support
Includes a Parquet format metadata.

Example code for usage:
```python
# install necessary packages, you can choose pyarrow or fastparquet
#%pip install pandas pyarrow

from tqdm.auto import tqdm
import pandas as pd
tqdm.pandas() # register progress_apply

# read parquet file
df = pd.read_parquet('metadata.parquet')
print(df.head()) # check the first 5 rows

#print(df.columns) # you can check the columns of the dataframe
necessary_rows = [
    "created_at", "score", "rating", "tag_string", "up_score", 
    "down_score", "fav_count"
]
df = df[necessary_rows] # shrink the dataframe to only necessary columns
df['created_at'] = pd.to_datetime(df['created_at']) # convert to datetime

datetime_start = pd.Timestamp('2007-01-01', tz='UTC')
datetime_end = pd.Timestamp('2008-01-01', tz='UTC')
subdf = df[(df['created_at'] >= datetime_start) & 
           (df['created_at'] < datetime_end)]

# count some rating
print(subdf['rating'].value_counts())
# export subdataframe
subdf.to_parquet('metadata-2007.parquet')
```

### 📥 Partial Downloads
To simplify downloading specific entries, use the **[CheeseChaser](https://github.com/deepghs/cheesechaser)** library:

```python
#%pip install cheesechaser # >=0.2.0
from cheesechaser.datapool import Danbooru2024SfwDataPool
from cheesechaser.query import DanbooruIdQuery

pool = Danbooru2024SfwDataPool()
#my_waifu_ids = DanbooruIdQuery(['surtr_(arknights)', 'solo']) 
# above is only available when Danbooru is accessible, if not, use following:
import pandas as pd

# read parquet file
df = pd.read_parquet('metadata.parquet', 
                     columns=['id', 'tag_string']) # read only necessary columns
                     
#surtr_(arknights) -> gets interpreted as regex so we need to escape the brackets
subdf = df[df['tag_string'].str.contains('surtr_\\(arknights\\)') & 
           df['tag_string'].str.contains('solo')]
ids = subdf.index.tolist()
print(ids[:5]) # check the first 5 ids

# download danbooru images with surtr+solo, to directory /data/exp2_surtr
pool.batch_download_to_directory(
    resource_ids=ids,
    dst_dir='/data/exp2_surtr',
    max_workers=12,
)
```
# Terms and Conditions for Dataset Use

## General Use Requirements
- **User Responsibility**:  
  Users must possess sufficient knowledge and expertise to use the dataset appropriately. Any derived works or outputs created using the dataset are the sole responsibility of the user. The creators of the dataset do not offer any guarantees or warranties regarding the outcomes or uses of such derived works.

## License Agreement
- **Mandatory Agreement**:  
  Usage of this dataset is contingent upon the user’s acceptance of the associated LICENSE terms. Without agreement, users are prohibited from utilizing the dataset.

- **Modifications and Updates**:  
  The dataset may be subject to updates or changes over time. These modifications are governed by the same LICENSE terms and conditions.

- **Opt-Out Compliance**:  
  The dataset aligns with the opt-out policy of the original booru database. If applicable, any modifications to this policy will be reflected and respected in the dataset.

## Prohibited Uses
The dataset explicitly prohibits the following activities:

1. **Harmful or Malicious Activities**:  
   - Using the dataset or its outputs to harass, threaten, or intimidate individuals or groups.  
   - Spreading false or misleading information.  
   - Any use intended to cause harm to individuals, organizations, or society.

2. **Illegal Activities**:  
   - Generating content or outputs that violate local, national, or international laws.  
   - Any use that breaches applicable regulations or promotes unlawful actions.

3. **Unethical or Offensive Content Modification**:  
   - Modified for producing controversial materials that go against ethical guidelines or community standards.  
   - Any use that could incite hate, violence, or discrimination.
  
## User Agreement and Acknowledgment
By using this dataset, users explicitly agree to:
- Adhere to the conditions specified in the LICENSE.
- Take full responsibility for how the dataset and its outputs are utilized, including any consequences resulting from their use.

## Disclaimer
- **No Warranties**:  
  The creators of the dataset provide it "as is" and make no warranties regarding the dataset's quality, reliability, or fitness for any particular purpose.

- **Indemnification**:  
  Users agree to indemnify and hold harmless the creators against any claims, damages, or liabilities arising from their use of the dataset.

## 🏷️ Dataset Information

- **License**: Other
- **Task Categories**:
  - Image Classification
  - Zero-shot Image Classification
  - Text-to-Image
- **Languages**:
  - English
  - Japanese
- **Tags**:
  - Art
  - Anime
- **Size Category**: 1M < n < 10M
- **Annotation Creators**: No annotation
- **Source Datasets**: [Danbooru](danbooru.donmai.us)

---
*Note: This dataset is provided for research and development purposes. Please ensure compliance with all applicable usage terms and conditions.*