This algorithm is a legacy one. The API has changed since its implementation. New versions and forks will need to be updated.

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.

Unnamed group

Endpoint Name Data Format Nature
image system/array_2d_uint8/1 Input
mean system/array_2d_floats/1 Input
normalized_image system/array_2d_floats/1 Output
xxxxxxxxxx
23
 
1
import bob
2
import numpy
3
4
5
class Algorithm:
6
7
    def __init__(self):
8
      self.mean = None
9
10
    def setup(self, parameters):
11
      return True
12
13
14
    def process(self, inputs, outputs):
15
16
      if self.mean is None:
17
        self.mean = inputs['mean'].data.value / 255.
18
19
      normalized_image = inputs["image"].data.value.astype('float64') / 255. - self.mean
20
      outputs["normalized_image"].write({'value': normalized_image})
21
22
      return True
23

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

Could not find any documentation for this object.

Experiments

Updated Name Databases/Protocols Analyzers
smarcel/tutorial/digit/2/mnist-mlp-nhu10-niter100-seed2001 mnist/1@idiap tutorial/multiclass_postperf/2
Created with Raphaël 2.1.2[compare]tutorial/mean_normalize/1tutorial/mean_normalize/22014Sep6

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.

Terms of Service | Contact Information | BEAT platform version 2.2.1b0 | © Idiap Research Institute - 2013-2025