Skip to content

Make it possible to let mediapipe be installed in headless environments #3661

@gentnm

Description

@gentnm

Please make sure that this is a feature request.

System information (Please provide as much relevant information as possible)
Official python docker image python:3.9-slim (Debian based)

  • MediaPipe Solution (you are using): mediapipe python package installed via pip
  • Programming language : Python
  • Are you willing to contribute it (Yes/No): Maybe (Need to check CLAs with my employer first)

Describe the feature and the current behavior/state:
Reopen from #3403
It would be great to be able to install mediapipe in a headless version.
Currently mediapipe in python depends on opencv-contrib-python which needs a lot of GUI components not needed in headless environments such as slimmed down docker containers. Due to this a lot of overhead is created for people using mediapipe in a streamlined environment without GUI interaction.
In order to make mediapipe run in headless environments, the opencv-contrib-python requirement could be swapped for opencv-python-headless .

I see three possible approaches for this:

  1. Just swap it completely
  2. Create a fork/alternative version (mediapipe-headless)
  3. Create a version with extras for the headless version (mediapipe[headless]

Will this change the current api? How?
In the headless version, maybe some features need to be turned off. I am not familiar with the complete set of features of mediapipe, so I am not sure if GUI features from opencv-contrib-python are used anywhere.
For my usecase everything seems to work fine.

Who will benefit with this feature?
Anyone running mediapipe in headless environments.

Please specify the use cases for this feature:
Create a service to be deployed in a cloud setting that takes an image and processes it with mediapipe.
No GUI features needed there.

Any Other info:
Sample docker file to demonstrate current problem:

FROM python:3.9-slim
RUN pip install mediapipe

ENTRYPOINT [ "python" , "-c"]
CMD [ "import mediapipe" ]

Metadata

Metadata

Assignees

Labels

platform:dockerIssues with dockerplatform:pythonMediaPipe Python issuesstat:awaiting googlerWaiting for Google Engineer's Responsetype:featureEnhancement in the New Functionality or Request for a New Solution

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions