Commit c22c0051 authored by Yannick DAYER's avatar Yannick DAYER

[py] Added distance prediction and scoring

Added a test in AlgorithmAdaptator enroll and score to not apply
'project()' in a distance algorithm.
parent 707e0a3b
Pipeline #37183 failed with stage
in 3 minutes and 29 seconds
......@@ -581,9 +581,12 @@ class AlgorithmAdaptor:
def enroll(self, k):
self.load()
return self.model.enroll(
[self.model.project(s.data) for s in k.samples]
)
if self.model.requires_projector_training:
return self.model.enroll(
[self.model.project(s.data) for s in k.samples]
)
else:
return [s.data for s in k.samples]
def write_enrolled(self, k, path):
self.model.write_model(k, path)
......@@ -652,7 +655,11 @@ class AlgorithmAdaptor:
retval = []
for p in probes:
data = [model.project(s.data) for s in p.samples]
if model.requires_projector_training:
data = [model.project(s.data) for s in p.samples]
else:
data = [s.data for s in p.samples]
for subprobe_id, (s, parent) in enumerate(zip(data, p.samples)):
# each sub-probe in the probe needs to be checked
subprobe_scores = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment