HMS-MLKit / HUAWEI-HMS-MLKit-Sample

HUAWEI HMS meachine learning services demo apk download.
https://developer.huawei.com/consumer/en/doc/development/HMS-Examples/ml-samplecode-4
Apache License 2.0
70 stars 36 forks source link

Is there any official label for segmentation? #20

Open cnliym opened 4 years ago

cnliym commented 4 years ago
    private int[] byteArrToIntArr(byte[] masks) {
        int[] results = new int[masks.length];
        for (int i = 0; i < masks.length; i++) {
            if (masks[i] == 1) {
                results[i] = Color.BLACK;
            } else if (masks[i] == 2) {
                results[i] = Color.BLUE;
            } else if (masks[i] == 3) {
                results[i] = Color.DKGRAY;
            } else if (masks[i] == 4) {
                results[i] = Color.YELLOW;
            } else if (masks[i] == 5) {
                results[i] = Color.LTGRAY;
            } else if (masks[i] == 6) {
                results[i] = Color.CYAN;
            } else if (masks[i] == 7) {
                results[i] = Color.RED;
            } else if (masks[i] == 8) {
                results[i] = Color.GRAY;
            } else if (masks[i] == 9) {
                results[i] = Color.MAGENTA;
            } else if (masks[i] == 10) {
                results[i] = Color.GREEN;
            } else {
                results[i] = Color.WHITE;
            }
        }
        return results;
    }

What the numbers 1-10 represent?

HMS-MLKit commented 4 years ago

yes, 0: background 1: human body 2: sky 3: plant 4: food 5: cat and dog 6: building 7: flower 8: water 9: sand 10: mountain You can also visit: https://developer.huawei.com/consumer/en/doc/development/HMS-References/MLImageSegmentationClassification-4 for more information. The bug was fixed by: https://github.com/HMS-MLKit/ai_mlkit_sample/pull/22