mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-02 02:51:40 +00:00
Preload OD models before import to check quantization (#2056)
Co-authored-by: samfreund <samf.236@proton.me> Co-authored-by: Sam Freund <techguy763@gmail.com>
This commit is contained in:
@@ -74,6 +74,8 @@ public class RknnObjectDetector implements ObjectDetector {
|
||||
if (objPointer <= 0) {
|
||||
throw new RuntimeException(
|
||||
"Failed to create detector from path " + model.modelFile.getPath());
|
||||
} else if (!RknnJNI.isQuantized(objPointer)) {
|
||||
throw new UnsupportedOperationException("Model must be quantized.");
|
||||
}
|
||||
|
||||
logger.debug("Created detector for model " + model.modelFile.getName());
|
||||
|
||||
@@ -80,6 +80,8 @@ public class RubikObjectDetector implements ObjectDetector {
|
||||
+ ". Please ensure the model is valid and compatible with the Rubik backend.");
|
||||
throw new RuntimeException(
|
||||
"Failed to create detector from path " + model.modelFile.getPath());
|
||||
} else if (!RubikJNI.isQuantized(ptr)) {
|
||||
throw new UnsupportedOperationException("Model must be quantized.");
|
||||
}
|
||||
|
||||
logger.debug("Created detector for model " + model.modelFile.getName());
|
||||
|
||||
Reference in New Issue
Block a user