File size: 640 Bytes
e0c25d9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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

---
task_categories:
- other
task_ids:
- other-image-classification
- image-classification
tags:
- auto-generated
- image-classification
---

# nateraw/auto-cats-and-dogs

Image Classification Dataset

## Usage

```python
from PIL import Image
from datasets import load_dataset

def pil_loader(path: str):
    with open(path, 'rb') as f:
        im = Image.open(f)
        return im.convert('RGB')

def image_loader(example_batch):
    example_batch['image'] = [
        pil_loader(f) for f in example_batch['file']
    ]
    return example_batch


ds = load_dataset('nateraw/auto-cats-and-dogs')
ds = ds.with_transform(image_loader)
```