1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00
Files
omrope79 b67ad9a422 Merge pull request #28678 from omrope79:caffe-importer-cleanup
Caffe importer cleanup #28678

Merge with: https://github.com/opencv/opencv_extra/pull/1324

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
- [x] The feature is well documented and sample code can be built with the project CMake
2026-06-02 17:28:10 +03:00

23 lines
1.1 KiB
CMake

set(sample example-mobilenet-objdetect)
# Explicitly ensure resource directories exist to guarantee smooth resource compiling
file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/res/raw")
# The Caffe MobileNet-SSD (mobilenet_iter_73000.caffemodel + deploy.prototxt) has been
# replaced by a single-file ONNX model. The sample now loads "res/raw/mobilenet.onnx".
if((DEFINED ENV{OPENCV_MOBILENET_SSD_ONNX_URL} OR DEFINED OPENCV_MOBILENET_SSD_ONNX_URL) AND OPENCV_MOBILENET_SSD_ONNX_HASH)
ocv_download(FILENAME "mobilenet.onnx"
HASH "${OPENCV_MOBILENET_SSD_ONNX_HASH}"
URL
"${OPENCV_MOBILENET_SSD_ONNX_URL}"
"$ENV{OPENCV_MOBILENET_SSD_ONNX_URL}"
DESTINATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res/raw"
ID OPENCV_MOBILENET_SSD_ONNX
STATUS res)
endif()
add_android_project(${sample} "${CMAKE_CURRENT_SOURCE_DIR}" LIBRARY_DEPS "${OPENCV_ANDROID_LIB_DIR}" SDK_TARGET 11 "${ANDROID_SDK_TARGET}")
if(TARGET ${sample})
add_dependencies(opencv_android_examples ${sample})
endif()