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, 'image')
self.label_dir = os.path.join(self.split_dir, 'label')
def rea

本文介绍了如何实现LLNet模型的数据读取接口,特别是在实际应用中将图片块转化为向量的过程,这一转化是在2018年5月24日进行的更新。
最低0.47元/天 解锁文章
3651

被折叠的 条评论
为什么被折叠?



