Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python backend] Add class_count argument for inference requests with BLS scripting #4647

Open
Rusteam opened this issue Jul 14, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@Rusteam
Copy link
Contributor

Rusteam commented Jul 14, 2022

Is your feature request related to a problem? Please describe.
I want to write a BLS with python backend that sends a request to a classifier with that has label_filename enabled in outputs. It's possible to do that with python tritonclient as InferRequestedOutput(name, class_count=top_k) that returns class names as well. It would be very handy to have the same functionality for pb_utils.InferenceRequest.

Describe the solution you'd like
I want to send a request from python backend to a classifier and get response that includes class probs along with class labels.

request = pb_utils.InferenceRequest(
            model_name=model_name,
            requested_output_names=pbutils.InferRequestedOutput(name, class_count=3), # change
            inputs=[pb_utils.Tensor("image", images)]
        )
resp = request.exec()

output = pb_utils.get_output_tensor_by_name(resp, name)
print(output)

### prints
### [[b'3.489491:79:100078', b'3.372420:255:100270', b'3.222686:78:100079']]

Describe alternatives you've considered
Duplicate labels.txt from the classifier to the python backend and parse values manually, but that includes duplication and extra code.

@krishung5
Copy link
Contributor

Thanks for submitting your request. @Tabrizian Is this a common ask? If so, I can file an enhancement ticket for this.

@Tabrizian
Copy link
Member

It is the first time but I think it is a reasonable ask. Please file a ticket for it. Thanks.

@krishung5
Copy link
Contributor

krishung5 commented Jul 15, 2022

Filed ticket 3970.

@krishung5 krishung5 added the enhancement New feature or request label Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants