Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/Fangyh09/Image2LMDB
- Owner: Fangyh09
- Created: 2019-05-11T02:47:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T23:38:11.000Z (almost 2 years ago)
- Last Synced: 2024-08-04T03:12:01.808Z (4 months ago)
- Topics: caffe, caffe2, lmdb, pytorch
- Language: Python
- Homepage:
- Size: 7.61 MB
- Stars: 64
- Watchers: 2
- Forks: 10
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
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