Operator Reference

train_sample_identifierT_train_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier (Operator)

train_sample_identifierT_train_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier — Train a sample identifier.

Warning

train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier is obsolete and is only provided for reasons of backward compatibility. New applications should use the operators for Deep-Learning-based classification instead, for details see Deep Learning / Classification.

Signature

train_sample_identifier( : : SampleIdentifier, GenParamName, GenParamValue : )

Herror T_train_sample_identifier(const Htuple SampleIdentifier, const Htuple GenParamName, const Htuple GenParamValue)

void TrainSampleIdentifier(const HTuple& SampleIdentifier, const HTuple& GenParamName, const HTuple& GenParamValue)

void HSampleIdentifier::TrainSampleIdentifier(const HTuple& GenParamName, const HTuple& GenParamValue) const

static void HOperatorSet.TrainSampleIdentifier(HTuple sampleIdentifier, HTuple genParamName, HTuple genParamValue)

void HSampleIdentifier.TrainSampleIdentifier(HTuple genParamName, HTuple genParamValue)

def train_sample_identifier(sample_identifier: HHandle, gen_param_name: Sequence[str], gen_param_value: Sequence[Union[str, int, float]]) -> None

Description

train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier trains the given SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier using the training data, which has been set with add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data.

For an explanation of the concept of sample-based identification see the introduction of chapter Legacy / Identification.

In order to be able to identify objects, the SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier must be trained with a representative set of sample images of the objects to be identified (see add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data).

To train the SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier, first, all the relevant sample images of the objects to be identified must be added with add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data. Alternatively, the preparation data can be reused. See prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier for an explanation on how to reuse preparation data for the training of the sample identifier. Then, with the call of train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier, the SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier is trained.

Note that the training itself is very fast and does not consume a lot of memory. Therefore, it is very easy to retrain the SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier, e.g., after new objects were added or already trained objects were removed from the SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier.

To retrain an existing sample identifier with new objects, just add the relevant sample images with add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data and call train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier, again. To remove objects, use the operator remove_sample_identifier_training_dataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingDataremove_sample_identifier_training_data and retrain the sample identifier with train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier.

Note that the training of the sample identifier is only possible, if the sample identifier contains training data for at least two different training objects.

The generic parameters GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name and GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value are intended for future use, only.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

SampleIdentifierSampleIdentifierSampleIdentifiersampleIdentifiersample_identifier (input_control)  sample_identifier HSampleIdentifier, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Handle of the sample identifier.

GenParamNameGenParamNameGenParamNamegenParamNamegen_param_name (input_control)  attribute.name-array HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)

Parameter name.

Default: []

List of values: []

GenParamValueGenParamValueGenParamValuegenParamValuegen_param_value (input_control)  attribute.value-array HTupleSequence[Union[str, int, float]]HTupleHtuple (real / string / integer) (double / string / int / long) (double / HString / Hlong) (double / char* / Hlong)

Parameter value.

Default: []

List of values: []

Result

If the parameters are valid, the operator train_sample_identifiertrain_sample_identifierTrainSampleIdentifierTrainSampleIdentifiertrain_sample_identifier returns the value 2 ( H_MSG_TRUE) . If necessary an exception is raised.

Possible Predecessors

add_sample_identifier_training_dataadd_sample_identifier_training_dataAddSampleIdentifierTrainingDataAddSampleIdentifierTrainingDataadd_sample_identifier_training_data

Possible Successors

apply_sample_identifierapply_sample_identifierApplySampleIdentifierApplySampleIdentifierapply_sample_identifier, write_sample_identifierwrite_sample_identifierWriteSampleIdentifierWriteSampleIdentifierwrite_sample_identifier

Alternatives

read_sample_identifierread_sample_identifierReadSampleIdentifierReadSampleIdentifierread_sample_identifier

See also

create_sample_identifiercreate_sample_identifierCreateSampleIdentifierCreateSampleIdentifiercreate_sample_identifier, add_sample_identifier_preparation_dataadd_sample_identifier_preparation_dataAddSampleIdentifierPreparationDataAddSampleIdentifierPreparationDataadd_sample_identifier_preparation_data, prepare_sample_identifierprepare_sample_identifierPrepareSampleIdentifierPrepareSampleIdentifierprepare_sample_identifier, apply_sample_identifierapply_sample_identifierApplySampleIdentifierApplySampleIdentifierapply_sample_identifier, set_sample_identifier_paramset_sample_identifier_paramSetSampleIdentifierParamSetSampleIdentifierParamset_sample_identifier_param, get_sample_identifier_paramget_sample_identifier_paramGetSampleIdentifierParamGetSampleIdentifierParamget_sample_identifier_param, get_sample_identifier_object_infoget_sample_identifier_object_infoGetSampleIdentifierObjectInfoGetSampleIdentifierObjectInfoget_sample_identifier_object_info, remove_sample_identifier_preparation_dataremove_sample_identifier_preparation_dataRemoveSampleIdentifierPreparationDataRemoveSampleIdentifierPreparationDataremove_sample_identifier_preparation_data, remove_sample_identifier_training_dataremove_sample_identifier_training_dataRemoveSampleIdentifierTrainingDataRemoveSampleIdentifierTrainingDataremove_sample_identifier_training_data, serialize_sample_identifierserialize_sample_identifierSerializeSampleIdentifierSerializeSampleIdentifierserialize_sample_identifier, deserialize_sample_identifierdeserialize_sample_identifierDeserializeSampleIdentifierDeserializeSampleIdentifierdeserialize_sample_identifier, clear_sample_identifierclear_sample_identifierClearSampleIdentifierClearSampleIdentifierclear_sample_identifier, set_sample_identifier_object_infoset_sample_identifier_object_infoSetSampleIdentifierObjectInfoSetSampleIdentifierObjectInfoset_sample_identifier_object_info

Module

Matching