Skip to content

Conversation

@ducviet00
Copy link
Contributor

@ducviet00 ducviet00 commented Jun 10, 2025

Description

I don't think torch is a hard dependency for sahi

from sahi.slicing import slice_image

  File "/usr/local/lib/python3.12/site-packages/sahi/__init__.py", line 4, in <module>
    from sahi.auto_model import AutoDetectionModel
  File "/usr/local/lib/python3.12/site-packages/sahi/auto_model.py", line 3, in <module>
    from sahi.models.base import DetectionModel
  File "/usr/local/lib/python3.12/site-packages/sahi/models/__init__.py", line 1, in <module>
    from . import base, detectron2, huggingface, mmdet, torchvision, ultralytics, yolov5, yolov8onnx
  File "/usr/local/lib/python3.12/site-packages/sahi/models/base.py", line 10, in <module>
    from sahi.utils.torch import empty_cuda_cache, has_torch, select_device
  File "/usr/local/lib/python3.12/site-packages/sahi/utils/torch.py", line 10, in <module>
    from torch import Tensor, device
ModuleNotFoundError: No module named 'torch'

@ducviet00
Copy link
Contributor Author

@fcakyon PTAL ❤️

@fcakyon fcakyon self-requested a review June 22, 2025 04:54
@fcakyon
Copy link
Collaborator

fcakyon commented Jun 22, 2025

@ducviet00 good point, it would be much better if slicing utils did not require pytorch, lets see if CI tests will pass 👍🏻

@fcakyon fcakyon added this pull request to the merge queue Jun 22, 2025
Merged via the queue into obss:main with commit d24f273 Jun 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants