Skip to content

Using YOLOv5 with Pillow-SIMD #7506

@glenn-jocher

Description

@glenn-jocher

Discussed in #7472

Originally posted by jkocherhans April 18, 2022
Hello! I’d like to use Pillow-SIMD (a drop-in replacement for Pillow) along with YOLOv5, but as soon as I import my model with torch.hub.load, check_requirements notices that Pillow isn’t installed and installs it automatically over the top of Pillow-SIMD. I can think of a few possible ways around this, but they all involve changing YOLOv5’s code.

  1. Stop installing dependencies and print out a warning instead. Basically this would change the install=True default in check_requirements to False. In a production environment, it’s surprising to me that importing code would cause a package to be installed, but I definitely see how the current behavior is helpful for most folks.
  2. Allow users to pass install=False into torch.hub.load, and pass that down to the call to check_requirements.
  3. Special case check_requirements to check for Pillow-SIMD as a fallback for Pillow.

If any combination of those options sound like a good idea to the maintainers, I’m happy to put together a PR.

Thank you!

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

    Issue actions