fmsfm commited on
Commit
1591fde
1 Parent(s): c3d534c

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -104,12 +104,11 @@ def single_scale_test(image):
104
  #torchvision.utils.save_image(1 - all_res, osp.join('RCFPyTorch0/results/RCF', 'result.jpg'))
105
  fuse_res = torch.squeeze(results[1].detach()).cpu().numpy()
106
  fuse_res = ((1 - fuse_res) * 255).astype('uint8')
107
- cv2.imwrite(osp.join("RCFPyTorch0/results/RCF", 'result_ss.png'), fuse_res)
108
  #print('\rRunning single-scale test [%d/%d]' % (idx + 1, len(test_loader)), end='')
109
  #print('Running single-scale test done')
110
- output = Image.open(os.path.join('RCFPyTorch0/results/RCF', 'result_ss.png'))
111
- #output = Image.fromarray(((fuse_res).astype('uint8')), mode='RGB')
112
- print(type(output))
113
  return output
114
 
115
  parser = argparse.ArgumentParser(description='PyTorch Testing')
 
104
  #torchvision.utils.save_image(1 - all_res, osp.join('RCFPyTorch0/results/RCF', 'result.jpg'))
105
  fuse_res = torch.squeeze(results[1].detach()).cpu().numpy()
106
  fuse_res = ((1 - fuse_res) * 255).astype('uint8')
107
+ #cv2.imwrite(osp.join("RCFPyTorch0/results/RCF", 'result_ss.png'), fuse_res)
108
  #print('\rRunning single-scale test [%d/%d]' % (idx + 1, len(test_loader)), end='')
109
  #print('Running single-scale test done')
110
+ #output = Image.open(os.path.join('RCFPyTorch0/results/RCF', 'result_ss.png'))
111
+ output = Image.fromarray((fuse_res).astype('uint8'))
 
112
  return output
113
 
114
  parser = argparse.ArgumentParser(description='PyTorch Testing')