Skip to content

Using headless? #1861

Open
Open
@afaulconbridge

Description

@afaulconbridge

Search before asking

  • I have searched the Supervision issues and found no similar feature requests.

Question

Is it possible to use supervision in a headless environment? If so, what is the recommended approach? This would require using opencv-python-headless instead of opencv-python in the dependencies.

Additional

#130 is related, but not a solution. opencv-python-headless and opencv-python are mutually exclusive dependencies - installing both breaks the environment.

I can see that in the past Supervision used to require headless and then moved to the gui-enabled version for wider ecosystem compatibility. I agree with that decision, but it puts users who want to use Supervion in a headless environment in a tricky situation.

For the ultraltyics package (which has the same problem) third parties have created a separate repository that modifies the dependency and distributes an alternative package - see https://github.com/Teriks/dgenerate-ultralytics-headless by @Teriks . I like this approach, but it does require manually ensuring that both opencv-python-headless and opencv-python do not end up installed in the same environment e.g. via transitive dependencies.

Ultimately, I feel the source of this challenge is opencv's legacy packaging choices, but that's not practically solvable for various reasons. If the communitiy could consistency approach it with the same solutions, then that would mitigate a lot of the downstream consequences for headless users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions