Publishing 2019 R1 content
[platform/upstream/dldt.git] / tools / accuracy_checker / accuracy_checker / representation / reid_representation.py
1 """
2 Copyright (c) 2019 Intel Corporation
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 """
16
17 from .base_representation import BaseRepresentation
18
19
20 class ReIdentification(BaseRepresentation):
21     pass
22
23
24 class ReIdentificationAnnotation(ReIdentification):
25     def __init__(self, identifier, camera_id, person_id, query):
26         super().__init__(identifier)
27         self.camera_id = camera_id
28         self.person_id = person_id
29         self.query = query
30
31
32 class ReIdentificationClassificationAnnotation(ReIdentification):
33     def __init__(self, identifier, positive_pairs=None, negative_pairs=None):
34         super().__init__(identifier)
35         self.positive_pairs = set(positive_pairs)
36         self.negative_pairs = set(negative_pairs)
37
38
39 class ReIdentificationPrediction(ReIdentification):
40     def __init__(self, identifiers, embedding):
41         super().__init__(identifiers)
42         self.embedding = embedding.copy()