jhgan00 / java-ort-example-yolov5

Onnxruntime Java Example: yolov5
34 stars 8 forks source link

what is 'record Detection',it is an entity class? #10

Closed Rivers-King closed 1 year ago

Rivers-King commented 1 year ago

I'm very sorry as I have just started learning about onnx-related knowledge. I now need to use my own trained onnx model to recognize images. However, I encountered an issue while using your code. I believe 'Detection' should be a class, and that's also my idea image

jhgan00 commented 1 year ago

The 'record' keyword was introduced in Java 14. Please check the version of Java you are using. Thank you.

jhgan00 commented 1 year ago
public class Detection {
    private final String label;
    private final float[] bbox;
    private final float confidence;

    public Detection(String label, float[] bbox, float confidence) {
        this.label = label;
        this.bbox = bbox;
        this.confidence = confidence;
    }

    public String getLabel() {
        return label;
    }

    public float[] getBbox() {
        return bbox;
    }

    public float getConfidence() {
        return confidence;
    }
}
Rivers-King commented 1 year ago

ok,i see,thank you