Media Server 25.4
Media Server Help

# Add an Object to a Database (Using Separate Steps)

This section describes how to create a new (empty) object, then add training images, and then train Media Server, using separate actions. You can also add metadata to the object, and configure training options, but these are optional steps. You might want to perform training in this way if you are building a front end application that responds to user input.

Alternatively, you can train Media Server to recognize an object by sending a single action. To do this, see Add an Object to a Database (Using a Single Action).

To add an object to a database (using separate steps)

1. Add an object using the NewObject action. For example:

   `curl http://localhost:14000/action=NewObject -F database=CompanyLogos -F identifier=AcmeCo`

2. Add one or more training images to the object using the AddObjectImages action.

   For example, to add a training image by supplying the image data:

   `curl http://localhost:14000/action=AddObjectImages -F database=CompanyLogos -F identifier=AcmeCo -F imagedata=@logo1.png`

   Alternatively, to add a training image by supplying its path, relative to the Media Server executable file:

   `curl http://localhost:14000/action=AddObjectImages -F database=CompanyLogos -F identifier=AcmeCo -F imagepath=logo1.png`

3. (Optional) Configure the way that Media Server is trained by setting training options for the object. To do this use the SetObjectTrainingOption action:

   `curl http://localhost:14000/action=SetObjectTrainingOption -F database=CompanyLogos -F identifier=AcmeCo -F key=useColor -F value=true`

4. (Optional) Add metadata to the object using the AddObjectMetadata action. You can add any number of key-value pairs. For example:

   `curl http://localhost:14000/action=AddObjectMetadata -F database=CompanyLogos -F identifier=AcmeCo -F key=category -F value=software`

5. Complete the training for the object using the BuildObject action.

   `curl http://localhost:14000/action=BuildObject -F database=CompanyLogos -F identifier=AcmeCo`

Copyright 2025 Open Text
Version 25.4 | Last updated October 2025

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: Knowledge Discovery Media Server 25.4

Topic Title: Add an Object to a Database (Using Separate Steps)