安装EfficientSAM过程记录

1. 可以从github或者hugging face下载测试程序

2. 最好用Hugging face中app.py进行测试,github中的例程EfficientSAM_example.ipynb的程序有些BUG需要自己调试,需要修改两处错误。

3. 主要以Hugging face进行讲解:

建立虚拟环境ESAM,采用conda建立虚拟环境:

conda create -n ESAM

pytorch安装最新版,根据官网安装说明安装torch 2.1稳定版。

conda install pytorch torchvision torchaudio pytorch-cuda=12.1 -c pytorch -c nvidia

安装好ESAM虚拟环境,再利用pip install -r requirement补齐所缺东西。

左键选择好待分割图像,如果觉得点选错了,点解Clear清除所有点。

之后点击“Segment with Point Prompt”生成单张的图像。

最后,成功实现了图像分割!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
The error message you're encountering suggests that there's an issue with importing the `YOLO_WORLD_EfficientSAM` module from a Python package. The `ImportError: attempted relative import with no known parent package` typically indicates that the code is trying to use a relative import (`from . import ...`) but the current directory structure does not have a proper package structure or the parent package has not been imported correctly. Here's what you can do to resolve this: 1. **Check package structure**: Ensure that you have a `__init__.py` file in the root directory of your package, as this is required for Python to recognize it as a package. If the module you're trying to import is in a subdirectory, move it up to the same level or create the necessary levels of directories (e.g., `your_package/your_subpackage`). 2. **Use absolute imports**: Instead of using relative imports, try importing the module using an absolute path, like `from yoloworld import YOLO_WORLD_EfficientSAM`. 3. **Ensure correct import statement**: If you are within a package, make sure you're importing the package correctly before attempting to import the submodule. For example, if the package is called `yoloworld`, you might need to do `import yoloworld` first and then use `from yoloworld.YOLO_WORLD_EfficientSAM import *`. 4. **Update PYTHONPATH**: If you're working in a development environment, ensure your PYTHONPATH environment variable includes the correct path to the package location. If you provide more details about your project setup and the exact context where you're encountering this error, I could give a more tailored solution. Here are some related questions for further clarification:

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值