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

Update HUB API requests #48

Open
3 tasks
Burhan-Q opened this issue Jan 21, 2024 · 1 comment
Open
3 tasks

Update HUB API requests #48

Burhan-Q opened this issue Jan 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working deployment enhancement New feature or request

Comments

@Burhan-Q
Copy link
Owner

After release of latest HUB API, bot inference requests no longer working

  • use new format
  • investigate account link authorization
  • test adding new tasks
@Burhan-Q Burhan-Q added bug Something isn't working enhancement New feature or request deployment labels Jan 21, 2024
@Burhan-Q
Copy link
Owner Author

NOTES HUB API requests:

Ultralytics HUB Documentation reference

  • f"https://api.ultralytics.com/v1/predict/{MODEL_ID}" is the new end point

    • this means users could pass in their own trained model
    • otherwise, need to use default model-id for the pretrained models (includes tasks besides detection)
  • all inference arguments are passed into data keyword as a dictionary

    • conf : prediction confidence
    • size : prediction image size
    • iou : prediction iou threshold
    • url : image URL
    • normalize

Note

Image URL can be passed directly to inference API

  • HUB account API key is required as part of the headers

    • headers = {"x-api-key": f"API_KEY"}
    • would be preferred if there was a means to obtain a key with zero intervention from the bot (linked/connected account) but the Discord docs don't make it obvious how to accomplish this (to me)
  • inference results returned as part of .json() method of response

    • for detect results, response is:
{data: [
  {
    class: int,
    confidence: float,
    name: str,
    width: float,
    height: float,
    xcenter: float,
    ycenter: float,
  }, 
  {...}, # additional objects detected
]

@Burhan-Q Burhan-Q self-assigned this Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working deployment enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant