某些python应用需要用到detectron2这个物体检测识别的工具,但是这个应用安装起来是比较麻烦的,我安装了试了一下报错了,而且没有足够的时间去研究,这里用另一个快速的方法安装。
这个方法用到的python版本需要3.10版
然后安装pytorch,我电脑12.4版本为例,安装torch 2.4.1,安装命令:
pip install torch==2.4.1 torchvision==0.19.1 --index-url https://download.pytorch.org/whl/cu124
下面开始安装detectron2,之前用mineru的时候安装过detectron2,这个是作者编译好了的各个系统的版本,我们就直接用他这个编译好的直接安装就可以了,链接如下:
https://wheels.myhloli.com/detectron2
比如我们是windows版,就运行下面命令安装:
pip install https://gcore.jsdelivr.net/gh/myhloli/wheels@main/assets/whl/detectron2/detectron2-0.6-cp310-cp310-win_amd64.whl
detectron2安装完成,非常简单