OpenCV-4.8.0
https://opencv.org/releases/
(alpha) D:\Deploy>wget https://cyfuture.dl.sourceforge.net/project/opencvlibrary/4.8.0/opencv-4.8.0-windows.exe?viasf=1
--2025-02-02 13:40:22-- https://cyfuture.dl.sourceforge.net/project/opencvlibrary/4.8.0/opencv-4.8.0-windows.exe?viasf=1
Resolving cyfuture.dl.sourceforge.net (cyfuture.dl.sourceforge.net)... 49.50.119.27
Connecting to cyfuture.dl.sourceforge.net (cyfuture.dl.sourceforge.net)|49.50.119.27|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 176191149 (168M) [application/octet-stream]
Saving to: 'opencv-4.8.0-windows.exe@viasf=1'
opencv-4.8.0-windows.exe@vias 100%[=================================================>] 168.03M 113KB/s in 19m 58s
2025-02-02 14:00:22 (144 KB/s) - 'opencv-4.8.0-windows.exe@viasf=1' saved [176191149/176191149]
include & lib & path
D:\Deploy\opencv-4.8.0\build\include
└─ opencv2
D:\Deploy\opencv-4.8.0\build\x64\vc16\lib
│ opencv_world480.lib
│ opencv_world480d.lib
└─ ...
D:\Deploy\opencv-4.8.0\build\x64\vc16\bin
│ opencv_world480.dll
│ opencv_world480d.dll
└─ ...
Release - x64
Proj-OpenCV-4.8.0
#include <opencv2\opencv.hpp>
#include <iostream>
using namespace std; // c++标准库中所有标识符都被定义于一个名为std的namespace中
using namespace cv;
int main()
{
Mat img = imread("D:/Deploy/scenario/images/1734613232.139.0.jpg");
if (img.empty())
{
cout << "Error......" << endl;
return 0;
}
imshow("Proj-OpenCV-4.8.0", img);
waitKey(0);
return 0;
}
libtorch-win-shared-with-deps-2.2.2+cu121
D:\Deploy>wget https://download.pytorch.org/libtorch/cu121/libtorch-win-shared-with-deps-2.2.2%2Bcu121.zip
--2025-02-02 15:26:56-- https://download.pytorch.org/libtorch/cu121/libtorch-win-shared-with-deps-2.2.2%2Bcu121.zip
Resolving download.pytorch.org (download.pytorch.org)... 108.139.10.61, 108.139.10.124, 108.139.10.87, ...
Connecting to download.pytorch.org (download.pytorch.org)|108.139.10.61|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2405749801 (2.2G) [application/zip]
Saving to: 'libtorch-win-shared-with-deps-2.2.2+cu121.zip'
libtorch-win-shared-with-deps 61%[=============================> ] 1.39G 245KB/s in 95m 48s
2025-02-02 17:02:46 (253 KB/s) - Connection closed at byte 1489657708. Retrying.
--2025-02-02 17:02:47-- (try: 2) https://download.pytorch.org/libtorch/cu121/libtorch-win-shared-with-deps-2.2.2%2Bcu121.zip
Connecting to download.pytorch.org (download.pytorch.org)|108.139.10.61|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 2405749801 (2.2G), 916092093 (874M) remaining [application/zip]
Saving to: 'libtorch-win-shared-with-deps-2.2.2+cu121.zip'
libtorch-win-shared-with-deps 85%[++++++++++++++++++++++++++++++===========> ] 1.92G 254KB/s in 36m 28s
2025-02-02 17:39:16 (256 KB/s) - Connection closed at byte 2063385389. Retrying.
--2025-02-02 17:39:18-- (try: 3) https://download.pytorch.org/libtorch/cu121/libtorch-win-shared-with-deps-2.2.2%2Bcu121.zip
Connecting to download.pytorch.org (download.pytorch.org)|108.139.10.61|:443... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 2405749801 (2.2G), 342364412 (327M) remaining [application/zip]
Saving to: 'libtorch-win-shared-with-deps-2.2.2+cu121.zip'
libtorch-win-shared-with-deps 100%[++++++++++++++++++++++++++++++++++++++++++=======>] 2.24G 261KB/s in 21m 52s
2025-02-02 18:01:11 (255 KB/s) - 'libtorch-win-shared-with-deps-2.2.2+cu121.zip' saved [2405749801/2405749801]
CUDA + cuDNN
include & lib & path
D:\Deploy\opencv-4.8.0\build\include
D:\Deploy\libtorch\include
D:\Deploy\libtorch\include\torch\csrc\api\include
D:\Deploy\libtorch\lib
D:\Deploy\libtorch\lib
Proj-Cuda-12.1
#include <torch/torch.h>
#include <torch/script.h>
#include <iostream>
using namespace std; // c++标准库中所有标识符都被定义于一个名为std的namespace中
#include <opencv2\opencv.hpp>
using namespace cv;
int main()
{
cout << "CUDA checking : " << torch::cuda::is_available() << endl;
cout << "cuDNN checking : " << torch::cuda::cudnn_is_available() << endl;
cout << "Device counting : " << torch::cuda::device_count() << endl;
torch::Tensor tensor = torch::arange(0, 25, torch::kFloat32).reshape({ 5,5 });
cout << "\n" << tensor << "\n" << endl;
if (true) {
cout << "Press any key to continue ..." << endl;
getchar();
}
return 0;
}
Release - x64