efa4e36adf0dbf0c39e53a9b38c07878340a8eaf,dvalib/analyzer.py,OpenImagesAnnotator,apply,#OpenImagesAnnotator#Any#,84
Before Change
im = PIL.Image.open(image_path)
bg = PIL.Image.new("RGB", im.size, (255, 255, 255))
bg.paste(im, im)
image_path = image_path.replace(".png",".jpg")
bg.save(image_path)
img_data = tf.gfile.FastGFile(image_path).read()
predictions_eval = np.squeeze(self.session.run(self.predictions, {self.input_image: img_data}))
results = {self.label_dict.get(self.labelmap[idx], "unknown"):predictions_eval[idx]
After Change
saver.restore(self.session, network_path)
def apply(self,image_path):
if self.session is None:
self.load()
img_data = tf.gfile.FastGFile(image_path).read()
predictions_eval = np.squeeze(self.session.run(self.predictions, {self.input_image: img_data}))
results = {self.label_dict.get(self.labelmap[idx], "unknown"):predictions_eval[idx]
for idx in predictions_eval.argsort()[-self.top_n:][::-1]}
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: AKSHAYUBHAT/DeepVideoAnalytics
Commit Name: efa4e36adf0dbf0c39e53a9b38c07878340a8eaf
Time: 2017-07-24
Author: akshayubhat@gmail.com
File Name: dvalib/analyzer.py
Class Name: OpenImagesAnnotator
Method Name: apply
Project Name: tsurumeso/waifu2x-chainer
Commit Name: a21db577ef31a91b5ae3901389929b4ca092be00
Time: 2017-02-23
Author: nstm101339@gmail.com
File Name: waifu2x.py
Class Name:
Method Name:
Project Name: NervanaSystems/coach
Commit Name: 5fadb9c18e3de16cc5633175199f9e9e2c381102
Time: 2018-11-07
Author: sina.beh@gmail.com
File Name: rl_coach/graph_managers/graph_manager.py
Class Name: GraphManager
Method Name: restore_checkpoint