3dc20bc15b767ad60edfc15154b630dbef8b79cc,onmt/IO.py,,read_img_file,#Any#Any#Any#Any#,94
Before Change
assert not truncate, "truncate not implemented yet!"
with codecs.open(path, "r", "utf-8") as corpus_file:
for i, line in enumerate(corpus_file) :
img_path = os.path.join(src_img_dir, line.strip())
if not os.path.exists(img_path):
img_path = line
After Change
assert os.path.exists(img_path), \
"img path %s not found" % (line.strip())
img = transforms.ToTensor()(Image.open(img_path))
if truncate and truncate != (0, 0):
if not (img.size(1) <= truncate[0]
and img.size(2) <= truncate[1]):
continue
example_dict = {side: img,
side+"_path": line.strip(),
"indices": index}
index += 1
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: OpenNMT/OpenNMT-py
Commit Name: 3dc20bc15b767ad60edfc15154b630dbef8b79cc
Time: 2017-12-12
Author: dengyuntian@gmail.com
File Name: onmt/IO.py
Class Name:
Method Name: read_img_file
Project Name: OpenNMT/OpenNMT-py
Commit Name: 5226e0bcdcb42b2d2d8806134599b70a5249d8a1
Time: 2017-12-29
Author: myscarlet@sina.com
File Name: tools/test_rouge.py
Class Name:
Method Name: test_rouge
Project Name: NifTK/NiftyNet
Commit Name: 37e2656912c22d8aefe94a1bab2eefa7c4f54ccc
Time: 2018-03-23
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/deconvolution.py
Class Name:
Method Name: infer_output_dims