def do_roc(self):
if self.gan_mode and self.dmodel2 is not None:
dmodel_cur = self.dmodel2
scale_factor = 2
elif self.dmodel is not None:
dmodel_cur = self.dmodel
scale_factor = self.scale_factor
else:
theApp.cur_hist_tex = theApp.standard_hist_tex
theApp.cur_roc_tex = theApp.standard_roc_tex
return
encoded_vector_source = self.get_encoded(dmodel_cur, self.cur_vector_source, scale_factor)
encoded_vector_dest = self.get_encoded(dmodel_cur, self.cur_vector_dest, scale_factor)
attribute_vector = encoded_vector_dest - encoded_vector_source
threshold = None
outfile = "{}/{}".format(roc_dir, get_date_str())
do_roc(attribute_vector, encoded, attribs, attribute_index, threshold, outfile)
hist_img = imread("{}_hist_both.png".format(outfile), mode='RGB')
roc_img = imread("{}_roc.png".format(outfile), mode='RGB')
hist_img = imresize(hist_img, roc_image_resize)
roc_img = imresize(roc_img, roc_image_resize)
theApp.cur_hist_tex = image_to_texture(hist_img)
theApp.cur_roc_tex = image_to_texture(roc_img)
评论列表
文章目录