Media Server 25.1
Media Server Help

# AddClassImages

Adds training images to an object class.

After adding training images to an object class, you must retrain the classifier using the action BuildClassifier.

Type: synchronous

Parameter | Description | Required
--- | --- | ---
`classifier` | The name of the classifier that contains the object class that you want to add images to. | Yes
`identifier` | The identifier of the object class that you want to add images to. | Yes
`imagedata` | The training images to add. Send files to Media Server using a multipart/form-data HTTP POST request. | Set this or `imagepath`.
`imagelabels` | A comma-separated list of labels to identify the images that you are adding (maximum 254 bytes for each label). Every image added to the same object class must have a unique label, so the number of labels must match the number of images provided using either `imagedata` or `imagepath`. If you do not set this parameter, Media Server generates labels automatically. | No
`imagepath` | A comma-separated list of paths to the training images to add. The paths must be absolute, or relative to the Media Server executable file. To strengthen security, Media Server can be configured to read files only from specified directories. For information about the directories that Media Server is permitted to read from, see the parameter AllowedInputDirectories. | Set this or `imagedata`.

## Example

The following example adds training images to an object class by specifying the paths of the images using the `imagepath` parameter:

    curl http://localhost:14000 -F action=addclassimages
                                -F classifier=vehicles
                                -F identifier=cars
                                -F imagepath=image1.jpg,image2.jpg
                                -F imagelabels=image1,image2

Alternatively, you can add training images by sending the image data, for example:

    curl http://localhost:14000 -F action=addclassimages
                                -F classifier=vehicles
                                -F identifier=cars
                                -F imagedata=@image1.jpg,image2.jpg
                                -F imagelabels=image1,image2

## Response

    <autnresponse xmlns:autn='http://schemas.autonomy.com/aci/'>
      <action>ADDCLASSIMAGES</action>
      <response>SUCCESS</response>
      <responsedata>
        <image>
          <index>1</index>
          <label>image1</label>
        </image>
        <image>
          <index>2</index>
          <label>image2</label>
        </image>
        ...
      </responsedata>
    </autnresponse>

## See Also

- If you haven't created a classifier, first run the action CreateClassifier.
- To add custom metadata to an object class, use the action AddClassMetadata.

Copyright 2024 Open Text
Version 25.1 | Last updated January 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.1

Topic Title: AddClassImages