SunDoge commited on
Commit ·
e97e76a
1
Parent(s): 8908073
add normalize
Browse files
main.py
CHANGED
|
@@ -29,6 +29,7 @@ def main():
|
|
| 29 |
img = cv2.resize(img, (224, 224), interpolation=cv2.INTER_LINEAR)
|
| 30 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 31 |
img = img.transpose((2, 0, 1)).astype(np.float32) / 255.0
|
|
|
|
| 32 |
|
| 33 |
encoder_session = ort.InferenceSession("output/encoder_model.onnx")
|
| 34 |
decoder_session = ort.InferenceSession("output/decoder_model.onnx")
|
|
|
|
| 29 |
img = cv2.resize(img, (224, 224), interpolation=cv2.INTER_LINEAR)
|
| 30 |
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 31 |
img = img.transpose((2, 0, 1)).astype(np.float32) / 255.0
|
| 32 |
+
img = (img - 0.5) / 0.5
|
| 33 |
|
| 34 |
encoder_session = ort.InferenceSession("output/encoder_model.onnx")
|
| 35 |
decoder_session = ort.InferenceSession("output/decoder_model.onnx")
|