mirror of https://github.com/davisking/dlib.git
Made --resample use a 64bit hash of the image data
in the file names to make it so there won't ever be any name conflicts in the cropped images.
This commit is contained in:
parent
7c828d0812
commit
6402a37458
|
@ -637,7 +637,11 @@ int resample_dataset(const command_line_parser& parser)
|
||||||
p.second = tform.get_tform()(p.second);
|
p.second = tform.get_tform()(p.second);
|
||||||
dimg.boxes.push_back(box);
|
dimg.boxes.push_back(box);
|
||||||
}
|
}
|
||||||
dimg.filename = data.images[i].filename + "RESAMPLED"+cast_to_string(j)+".png";
|
// Put a 64bit hash of the image data into the name to make sure there are no
|
||||||
|
// file name conflicts.
|
||||||
|
std::ostringstream sout;
|
||||||
|
sout << hex << murmur_hash3_128bit(&chip[0][0], chip.size()*sizeof(chip[0][0])).second;
|
||||||
|
dimg.filename = data.images[i].filename + "_RESAMPLED_"+sout.str()+".png";
|
||||||
|
|
||||||
save_png(chip,dimg.filename);
|
save_png(chip,dimg.filename);
|
||||||
resampled_data.images.push_back(dimg);
|
resampled_data.images.push_back(dimg);
|
||||||
|
|
Loading…
Reference in New Issue