Help Center> Huawei HiLens> Developer Guide> Hard Example Upload Module> Uploading a Hard Example Image Set
Updated on 2022-02-22 GMT+08:00

Uploading a Hard Example Image Set

This API is used to upload a hard example image set. The name of the uploaded file is in the format of model_name-camera_name-index.jpg. If a file with the same name exists in the folder, the file will be overwritten. You can add a timestamp to model_name or camera_name to prevent the file from being overwritten. Note that the OBS file name can contain a maximum of 1,024 characters.

  • API calling

    upload_jpeg(upload_url, index, model_name, camera_name, frame)

  • Parameter description
    Table 1 Parameters

    Parameter

    Mandatory

    Type

    Description

    upload_url

    Yes

    string

    URL of the hard example set to be uploaded.

    To obtain the URL of a hard example set, configure the corresponding dataset on the hard example upload page and then use get_hard_sample_config to obtain the hard example configurations. For details, see Obtaining Hard Example Configurations. The dataset_path parameter in the return value corresponds to the URL of the dataset.

    index

    Yes

    int

    Sequence number of the image to be uploaded

    model_name

    Yes

    string

    Name of the model corresponding to the image to be uploaded

    camera_name

    Yes

    string

    Name of the camera corresponding to the image to be uploaded

    frame

    Yes

    mat

    Image to be uploaded. The image must be in NV21 format.

  • Return value

    A Bool value is returned. True indicates that the image is successfully uploaded, and False indicates that the image fails to be uploaded.