用OpenCV-Python使用的更改代替OpENCV

发布于 2025-01-27 02:09:11 字数 818 浏览 1 评论 0原文

我正在研究一个使用OpenCV-Python的项目。由于规格很少,我不得不在OpenCV代码(从开源接收)中进行很少的代码更改。现在,我希望OpenCV-Python使用我创建的自定义OpenCV(我已将其存储在Bitbucket中)。我正在使用opencv-python安装opencv-python,

pip install git+bitbucketurl

我将OpenCV-Python源代码存储在我的私人位Bucket中。

我尝试过的东西是

  1. 从OpenCV-Python源代码中删除OpenCV子模块,并将我的私人OpenCV repo添加为子模块(已在BitBucket链接中添加了用户名和密码),
  2. 将OpenCV-Python递归克隆并替换为默认的OpenCV文件夹我的自定义OPENCV(具有相同名称)
  3. 执行步骤1和步骤2
  4. 删除OpenCV-Python(MultiBuild,OpenCV-Extra,OpenCV-Contrib)随附的其他子模块,

但上述方法均无效。以某种方式,即使在更改子模块之后,我也会下载opensource openCV,而不是定制一个存储在Bitbucket上的自定义,我在创建subpodule时添加了链接。

我用它来删除子模块: https://stackoverflow.com/a/1260982/1260982/7545777

使用的git suppodule添加自定义

I am Working on a project which uses opencv-python. Due to few specifications I had to make few code changes in the opencv code( Received from open source). Now I want the opencv-python to use the custom opencv I created ( i have stored it in bitbucket). I am installing opencv-python using

pip install git+bitbucketurl

I have stored the opencv-python source code in my private bitbucket.

Things that i have tried are

  1. Delete the opencv submodule from opencv-python source code and add my private opencv repo as a submodule ( have added the username and password in bitbucket link itself)
  2. recursively clone the opencv-python and replace the default opencv folder with my custom opencv ( with same name)
  3. Doing both step 1 and step 2
  4. Deleting the other submodules that comes with opencv-python ( multibuild , opencv-extra , opencv-contrib)

but none of the above methods worked. Somehow when i do pip install even after changing the submodule it downloads the opensource opencv instead of custom one stored at bitbucket whose link i added while creating submodule.

I used this to delete the submodule : https://stackoverflow.com/a/1260982/7545777

to add the submodule i used git submodule add customopencvurl

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌入人心 2025-02-03 02:09:11

我错过的步骤是建立轮子。因此,在进行必要的更改后,即替换子模块,我们必须构建轮子,这是在您进行PIP安装时使用的。用于重建方向盘的命令是

pip wheel . --verbose

The step that I missed was building the wheel. So after making the necessary changes i.e replacing the submodule we have to build the wheel, which is used when you do pip install. Command used to rebuild the wheel is

pip wheel . --verbose
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文