Exporting fp16 onnx models.

This commit is contained in:
Daniel
2024-11-29 17:37:44 +01:00
parent 7b9505ca02
commit 19015c6326
10 changed files with 107 additions and 13 deletions

View File

@ -45,7 +45,7 @@ class SimCC(BaseModel):
def preprocess(self, image: np.ndarray):
tensor, self.dx, self.dy, self.scale = image, 0, 0, 1
tensor = tensor.astype(np.float32, copy=False)
tensor = tensor.astype(self.input_type, copy=False)
tensor = np.expand_dims(tensor, axis=0).transpose((0, 3, 1, 2))
return tensor