Algorithms have at least one input and one output. All algorithm endpoints are organized in groups. Groups are used by the platform to indicate which inputs and outputs are synchronized together. The first group is automatically synchronized with the channel defined by the block in which the algorithm is deployed.
Endpoint Name | Data Format | Nature |
---|---|---|
scores | tutorial/probe_scores/1 | Input |
Analyzers may produce any number of results. Once experiments using this analyzer are done, you may display the results or filter experiments using criteria based on them.
Name | Type |
---|---|
frr | float32 |
far | float32 |
roc | plot/scatter/1 |
eer | float32 |
number_of_positives | int32 |
threshold | float32 |
number_of_negatives | int32 |
xxxxxxxxxx
import bob
import bob.measure
import numpy
class Algorithm:
def __init__(self):
self.positives = []
self.negatives = []
def process(self, inputs, output):
# accumulate the scores
data = inputs['scores'].data
self.positives.extend([k.score for k in data.scores if k.template_identity == data.client_identity])
self.negatives.extend([k.score for k in data.scores if k.template_identity != data.client_identity])
# once all values are received, evaluate the scores
if not(inputs.hasMoreData()):
eer_threshold = bob.measure.eer_threshold(self.negatives, self.positives)
far, frr = bob.measure.farfrr(self.negatives, self.positives, eer_threshold)
roc_points = bob.measure.roc(self.negatives, self.positives, 100)
# writes the output back to the platform
output.write({
'eer': numpy.float32((far+frr) / 2.),
'far': numpy.float32(far),
'frr': numpy.float32(frr),
'threshold': numpy.float32(eer_threshold),
'number_of_positives': numpy.int32(len(self.positives)),
'number_of_negatives': numpy.int32(len(self.negatives)),
'roc': {
"data":
[
{
"label": "roc",
"x": roc_points[0],
"y": roc_points[1],
}
]
},
})
return True
The code for this algorithm in Python
The ruler at 80 columns indicate suggested POSIX line breaks (for readability).
The editor will automatically enlarge to accomodate the entirety of your input
Use keyboard shortcuts for search/replace and faster editing. For example, use Ctrl-F (PC) or Cmd-F (Mac) to search through this box
Updated | Name | Databases/Protocols | Analyzers | |||
---|---|---|---|---|---|---|
teodors/teodors/datatype_problem/1/example_aggregation_as_lists_repacking_variables | atnt/3@idiap | tutorial/postperf/1 | ||||
AntonioCandia/AntonioCandia/eigenface_preprop/1/eigenface-with-10-components | atnt/1@idiap | tutorial/postperf/1 | ||||
anjos/tutorial/eigenface/1/demo42 | atnt/1@idiap | tutorial/postperf/1 |
This table shows the number of times this algorithm has been successfully run using the given environment. Note this does not provide sufficient information to evaluate if the algorithm will run when submitted to different conditions.