Install ncnn on Raspberry Pi 4 - Q-engineering
Q-engineering
Q-engineering
Go to content
images/empty-GT_imagea-1-.png
Install ncnn software on Raspberry Pi 4

Install ncnn deep learning software on a Raspberry Pi 4.


						
						#ifdef USE_OPENCV
						#include <opencv2/highgui/highgui_c.h>
						#include <stdint.h>
						
						#include <algorithm>
						#include <map>
						#include <string>
						#include <utility>
						#include <vector>
						
						#include "opencv2/core/core.hpp"
						#include "opencv2/highgui/highgui.hpp"
						#include "opencv2/imgproc/imgproc.hpp"
						
						#include "caffe/data_transformer.hpp"
						#include "caffe/internal_thread.hpp"
						#include "caffe/layers/base_data_layer.hpp"
						#include "caffe/layers/window_data_layer.hpp"
						#include "caffe/util/benchmark.hpp"
						#include "caffe/util/io.hpp"
						#include "caffe/util/math_functions.hpp"
						#include "caffe/util/rng.hpp"
						
						// caffe.proto > LayerParameter > WindowDataParameter
						//   'source' field specifies the window_file
						//   'crop_size' indicates the desired warped size
						
						namespace caffe {
						
						template 
						WindowDataLayer::~WindowDataLayer() {
						  this->StopInternalThread();
						}
						
						template 
						void WindowDataLayer::DataLayerSetUp(const vector*>& bottom,
						      const vector*>& top) {
						  // LayerSetUp runs through the window_file and creates two structures
						  // that hold windows: one for foreground (object) windows and one
						  // for background (non-object) windows. We use an overlap threshold
						  // to decide which is which.
						
						  // window_file format
						  // repeated:
						  //    # image_index
						  //    img_path (abs path)
						  //    channels
						  //    height
						  //    width
						  //    num_windows
						  //    class_index overlap x1 y1 x2 y2
						
						  LOG(INFO) << "Window data layer:" << std::endl
						      << "  foreground (object) overlap threshold: "
						      << this->layer_param_.window_data_param().fg_threshold() << std::endl
						      << "  background (non-object) overlap threshold: "
						      << this->layer_param_.window_data_param().bg_threshold() << std::endl
						      << "  foreground sampling fraction: "
						      << this->layer_param_.window_data_param().fg_fraction() << std::endl
						      << "  cache_images: "
						      << this->layer_param_.window_data_param().cache_images() << std::endl
						      << "  root_folder: "
						      << this->layer_param_.window_data_param().root_folder();
						
						
						
Deep learning software for Raspberry Pi
Raspberry and alt
Install
Raspberry Pi 4
Back to content