Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Fangyh09/Image2LMDB

Convert image folder to lmdb, adapted from Efficient-PyTorch
https://github.com/Fangyh09/Image2LMDB

caffe caffe2 lmdb pytorch

Last synced: 2 days ago
JSON representation

Convert image folder to lmdb, adapted from Efficient-PyTorch

Awesome Lists containing this project

README

        

# Image2LMDB
Convert image folder to lmdb, adapted from https://github.com/Lyken17/Efficient-PyTorch
```
.
├── folder2lmdb.py
├── img
│   ├── train
│   │   ├── bar_dir
│   │   │   ├── 100000.jpg
│   │   │   ├── 100001.jpg
│   │   │   ├── 100002.jpg
│   │   │   ├── 100003.jpg
│   │   │   ├── 100004.jpg
│   │   │   ├── 100005.jpg
│   │   │   ├── 100006.jpg
│   │   │   ├── 100007.jpg
│   │   │   ├── 100008.jpg
│   │   │   └── 100009.jpg
│   │   └── foo_dir
│   │   ├── 100000.jpg
│   │   ├── 100001.jpg
│   │   ├── 100002.jpg
│   │   ├── 100003.jpg
│   │   ├── 100004.jpg
│   │   ├── 100005.jpg
│   │   ├── 100006.jpg
│   │   ├── 100007.jpg
│   │   ├── 100008.jpg
│   │   └── 100009.jpg
│  
│  
├── main.py
├── README.md
└── requirements.txt
```

## Convert image folder to lmdb
```python
python folder2lmdb.py img
````

## Test it
```python
python main.py img/train.lmdb
```

```
key 0
key 1
torch.Size([2, 224, 224, 3])
key 2
key 3
torch.Size([2, 224, 224, 3])
key 4
key 5
torch.Size([2, 224, 224, 3])
key 6
key 7
torch.Size([2, 224, 224, 3])
key 8
key 9
torch.Size([2, 224, 224, 3])
key 10
key 11
torch.Size([2, 224, 224, 3])
key 12
key 13
torch.Size([2, 224, 224, 3])
key 14
key 15
torch.Size([2, 224, 224, 3])
key 16
key 17
torch.Size([2, 224, 224, 3])
key 18
key 19
torch.Size([2, 224, 224, 3])
```

## Original Repo:
https://github.com/Lyken17/Efficient-PyTorch