Skip to content

classify

David Wood edited this page Apr 7, 2022 · 1 revision

classify

Classifies one or more sounds against a trained model (see train).

Classifies sounds using a local model or one on a server.
Three different operating modes are available as follows:
  1) Classify 1 or more sounds and exit.
  2) Start a server that will listen for http requests containing a wav 
      file to classify.
  3) Start a monitor process that will capture sounds and classify them. 
In all 3 cases, classification results may be sent to an IOT platform.
Mode options:
  -classify : classify 1 or more files and exit.  The default mode.
  -monitor : Starts a monitor that captures sounds to be classified.
  -server  : Causes a server to be created that listens for http classify requests.
Model/Classifier options:
  A classifier must be specified using either -file or -name option
  -file file : a file containing the classifier to use to perform classifications
     locally.
Classify mode options
  -t : Show classification time. Times are not effected by console output.
  -clipLen msec : clip windows into sub windows of the given size and classify
       each sub-clip separately. Generally only used with -t. Default is no clipping.
  -pad (no|zero|duplicate): when clips are shorter than the requests clip
      padding can be added to make all clips the same length. Some models may
      require this.  Zero padding sets the added samples to zero.  Duplicate
      reuses the sound as many times a necessary to set the added samples.
      Default is no padding.
  -maxClips n : only do the given number of classifications. Generally used with
       -t to limit the number of classifications. Default is no maximum.
Server mode options:
  -server-port port : Specifies the port for the server to run on.  Default is 80.
Monitor mode options:
  -clipLen msec : Specifies the length of the clip to capture and classify. Default is 5000.
  -pauseLen msec : Specifies the time length between captured clips. Default is 0.
IOT options (if not specified, then events will not be sent to an IOT Platform):
  -iotp-properties file : Specifies the file containing IOT platform connections.
     properties.  The following must be specified, if not specified on the command line.
         Organization-ID, API-Key and Authentication-Token
  -iotp-org org: Specifies the orginization ID of the IOT Platform to publish events.
  -iotp-api-key key: Specifies the API key for the IOT Platform organization.
  -iotp-auth-token token : Specifies the IOT Platform API key authorization token.
  The organization ID, api key and auth token must all be specified via one of the
  mechanisms above.
  -user name: user name used for authentication. No default.
  -pwd  pwd: password used for authentication. No default.
   User/password authentication with IBM ID enables access to the IOT Platform.
  -sensor-name name : Name of the sensor used to name the device on the IOT Platform. 
         Resulting name is combination of user name and this value.  Required.
  -sensor-location location: Location for the device created on the IOT Platform.
  -sensor-sublocation location: Sub-location for the device created on the IOT Platform.
  -event name : name of event to publish classifications under. Default is sensorStatus.
Classify examples: 
  ... -name myclassifier wavfile1 wavefile2 ...
Monitor examples: 
  ... -monitor -file myclassifier.cfr
  ... -monitor -iotp-properties iotp.props -file myclassifier.cfr
Server examples: 
  ... -server -file myclassifier.cfr 
Server request: curl --data-binary '@your.wav' -H 'Content-Type:audio/wav' \
                      http://localhost/classifyWAV
Clone this wiki locally