Skip to content

recognitionService.recognize without limit parameter results in malformed url #33

Open
@No3x

Description

@No3x

Describe the bug
If you call recognize without limit parameter the url is not valid and a 400 is returned from the REST API.

To Reproduce

try {
    const result = await recognitionService.recognize(path_toTestImage, {
      face_plugins: 'landmarks,gender,age',
      det_prob_threshold: 0.95,
      status: true
    });
} catch (e) {
    console.error('Error while recognize' + e.message);
    console.error(e.config.url); // <-- comes here. not good
}

Prints
http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95?face_plugins=landmarks,gender,age?status=true

Expected behavior
If I do not pass limit it should use a default or build a valid url.
Should be
http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95&face_plugins=landmarks,gender,age&status=true

Maybe other webservers/backends do not care but I use the docker-compose version from https://github.com/exadel-inc/CompreFace/releases/tag/v1.0.0

Activity

No3x

No3x commented on May 19, 2022

@No3x
Author

I did another check and it seems like it can be reproduced also with

const result = await recognitionService.recognize(path_toTestImage, {
      det_prob_threshold: 0.95,
      status: true
});

http://localhost:8000/api/v1/recognition/recognize?det_prob_threshold=0.95?status=true

Adding limit fixes it

const result = await recognitionService.recognize(path_toTestImage, {
      limit: 0,
      det_prob_threshold: 0.95,
      status: true
});
smchedlidze826

smchedlidze826 commented on Jun 1, 2022

@smchedlidze826
Collaborator

We are working on this issue and it will be fixed in the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @No3x@smchedlidze826

        Issue actions

          recognitionService.recognize without limit parameter results in malformed url · Issue #33 · exadel-inc/compreface-javascript-sdk