def get_batch(batch_size,original_size,shrunk_size):
global batch_index
max_counter = len(train_set)//batch_size
counter = batch_index % max_counter # batch_index范围 0-19
window = [x for x in range(counter*batch_size,(counter+1)*batch_size)]
imgs = [train_set[q] for q in window]
x = [transform.resize(get_image(q,original_size),(shrunk_size,shrunk_size)) for q in imgs]
y = [get_image(q,original_size) for q in imgs]
batch_index = (batch_index+1)%max_counter
return x,y
SR取图像集
最新推荐文章于 2024-08-24 21:18:40 发布