This repository provides a simple utility for handling Databases(LMDB, HDF5) with images and annotations. You can store and retrieve images and their corresponding annotations efficiently using this handler.
- Store and retrieve images with annotations in database.
- Easy-to-use functions for saving and loading data.
- Supports encoding images using
cv2
to save space.
- Clone the repository:
git clone https://github.com/KDL-Solution/FileHandler
cd FileHandler
- Install the required dependencies:
pip install -r requirements.txt
How to Use
#from uploader import LMDBUploader as uploader
from uploader import HDF5Uploader as uploader
# 이미지와 라벨 경로
data_pairs = [
("./data/img1.jpg", "./data/label1.json"),
("./data/img2.jpg", "./data/label2.json"),
("./data/img3.jpg", "./data/label3.json"),
("./data/img4.jpg", "./data/label4.json"),
("./data/img5.jpg", "./data/label5.json"),
]
# 업로더 생성
uploader = LMDBUploader("lmdb_test", mode='w', max_workers=10, verbose=True)
# 실행
uploader.upload(data_pairs)