geti-sdk icon indicating copy to clipboard operation
geti-sdk copied to clipboard

Choosing labels based on their names for classification models

Open jcchr opened this issue 11 months ago • 0 comments

Summary

Model API - used by geti-sdk to perform inference, returns results based on a list of labels which is sorted alphabetically - whereas geti-sdk works on a list ordered like it is in a model itself. In some cases order of labels might be different in both libraries - which leads to problems like the one described here : https://github.com/open-edge-platform/geti/issues/1578

Correction is to establish labels returned by model based on their names instead of using their location on a list. Change should be done for classification models only - as a change related to sorting labels was introduced only for this kind of models.

How to test

Execute inference on a model - checking first if labels in a model (check the .xml file with models - list of labels is located at the end of it) are not sorted alphabetically. Check if results of inference are ok.

Checklist

  • [x] I have tested my changes manually.​
  • [ ] I have added tests to cover my changes.​

License

  • [ ] I submit my code changes under the same Apache License that covers the project. Feel free to contact the maintainers if that's a concern.
  • [ ] I have updated the license header for each file (see an example below).
# Copyright (C) 2025 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions
# and limitations under the License.

jcchr avatar Dec 05 '25 10:12 jcchr