akhaliq HF Staff commited on
Commit
f735daf
·
1 Parent(s): 961cfc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -105,6 +105,12 @@ def get_model(ctx, model_path):
105
  # Download test image
106
  mx.test_utils.download('https://s3.amazonaws.com/onnx-model-zoo/duc/city1.png')
107
 
 
 
 
 
 
 
108
 
109
  # Download ONNX model
110
  mx.test_utils.download('https://s3.amazonaws.com/onnx-model-zoo/duc/ResNet101_DUC_HDC.onnx')
 
105
  # Download test image
106
  mx.test_utils.download('https://s3.amazonaws.com/onnx-model-zoo/duc/city1.png')
107
 
108
+ # read image as rgb
109
+ im = cv.imread(im)[:, :, ::-1]
110
+ # set output shape (same as input shape)
111
+ result_shape = [im.shape[0],im.shape[1]]
112
+ # set rgb mean of input image (used in mean subtraction)
113
+ rgb_mean = cv.mean(im)
114
 
115
  # Download ONNX model
116
  mx.test_utils.download('https://s3.amazonaws.com/onnx-model-zoo/duc/ResNet101_DUC_HDC.onnx')