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

@ -24,7 +24,7 @@ class RTMDet(BaseModel):
tensor, self.dx, self.dy, self.scale = letterbox(
image, (tw, th), fill_value=114
)
tensor = tensor.astype(np.float32, copy=False)
tensor = tensor.astype(self.input_type, copy=False)
tensor = tensor[..., ::-1]
tensor = np.expand_dims(tensor, axis=0).transpose((0, 3, 1, 2))
return tensor