1. 简介
实现LLNet模型的数据读取接口
2. 代码实现
# Ref: LLNet: Deep Autoencoders for Low-light Image Enhancement
#
# Author: HSW
# Date: 2018-05-11
#
import tensorflow as tf
import numpy as np
from PIL import Image
import os
import sys
import cv2
import sklearn.preprocessing as prep
# Training/Testing Samples
TRAIN_NUM_SAMPLES = 7481
TEST_NUM_SAMPLES = 7518
class LLNet_Data(object):
def __init__(self, root_dir, split="training"):
self.root_dir = data_set_dir
self.split = split
self.split_dir = os.path.join(root_dir, split)
if split == "training":
self.num_samples = TRAIN_NUM_SAMPLES
elif split == "testing":
self.num_samples = TEST_NUM_SAMPLES
else:
print("Unknow split: %s", %(split))
exit(-1)
self.image_dir = os.path.join(self.split_dir