Open topic with navigation
Training Media Server updates the training database. However, the training is not used in analysis operations until Media Server has synchronized with the database. Synchronization loads the data from the database into memory and makes it ready for use. Synchronization is necessary because several Media Servers can share a single database, and you can use any Media Server to perform training.
The default configuration ensures that analysis uses the latest training data, but you can customize Media Server for your use case.
The default configuration ensures that analysis uses the latest training data, no matter how often you train Media Server and how much training data you add to the database.
Before it starts a
process action that requires training data, Media Server synchronizes with the training database and waits for the synchronization to complete. This is because the
SyncDatabase parameter - available for tasks that use stored training data - has a default value of
Media Server also synchronizes with the database at regular intervals (by default, every second). You can configure the interval between each synchronization by setting the
SyncInterval parameter in the
[Database] section of the configuration file. This is important for processing video streams, because when you process a stream Media Server could continue running the same action for days or weeks. Automatic synchronization ensures that Media Server regularly loads the latest training without you having to intervene.
If you add a large amount of training data and then immediately start a
process action, Media Server might not use the latest training. This is because some training actions are asynchronous and the new training might not have been committed to the database before the
process action starts. The new training will therefore not be synchronized. To be sure that Media Server is using the latest training, ensure that all training actions for the training that you wish to use have completed before sending the
In some cases, you might want to control when Media Server synchronizes with the training database:
processrequests all use the same training. If you are processing discrete files, you might perform training in bulk and then process batches of files.
The configuration parameter
ScheduledSync specifies whether Media Server synchronizes with the database at regular intervals. The default value is
periodic, which enables scheduled synchronization at intervals defined by the parameter
SyncInterval. To load training data when Media Server starts, but not synchronize with the database at regular intervals, set
ScheduledSync=startup. To disable scheduled synchronization completely, set
ScheduledSync=never. In this case, Media Server does not load any training data when it starts and does not synchronize with the database at timed intervals.
To prevent Media Server synchronizing with the database before it starts a
process action, set
SyncDatabase=FALSE in the relevant analysis tasks. With this setting, be aware that
process requests could use outdated training.
If you disable automatic synchronization but want to ensure that Media Server has synchronized with the latest training, run the
SyncClassifiers action before you send the
process action. The
SyncClassifiers action forces Media Server to synchronize with the database, and after it completes, you can be sure that Media Server is using the latest training data.
With automatic synchronization, described above, Media Server loads all training data into memory. If you have an extremely large training database that contains many face databases, object databases, classifiers, and so on, this can consume a significant amount of memory.
To load only the training you need, set
ScheduledSync=never to disable scheduled synchronization. If you set
ScheduledSync=startup, Media Server loads all training data when it starts but you can remove training from memory as required. If you set
ScheduledSync=never, Media Server does not load any training data when it starts, so you can load only the training data you need. With either of these options, Media Server does not synchronize with the database at regular intervals.
To load training or remove training from memory, use one of the following methods:
[TaskName]section for your analysis task. Media Server will load the training it needs to complete the task. This ensures that Media Server uses the latest training.
[TaskName]section for your analysis task. Then, manually synchronize the training data by running the action