Giter Site home page Giter Site logo

qengineering / rpi-image Goto Github PK

View Code? Open in Web Editor NEW
125.0 6.0 20.0 86 KB

Raspberry Pi 4 Buster 64-bit OS with deep learning examples

Home Page: https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html

License: BSD 3-Clause "New" or "Revised" License

raspberry-pi-4 raspberry-pi-image deep-learning cpp aarch64 raspberry-pi-64-os armv8 ncnn paddle-lite tensorflow-lite mnn ssd pose-estimation face-recognition opencv sd-card-image tensorflow computer-vision

rpi-image's Introduction

Raspberry Pi 4 Buster DNN image

output image

A Raspberry Pi 4 Buster 64-OS image with deep-learning examples

License

June 12, 2023

Update 7-26-2022.

  • New download site (Gdrive has a limited number of downloads per day).

February 19, 2022

  • Use PiShrink to support of different SD sizes. Reduced the file from 4.83 to 2.68 GByte

January 24, 2022

  • Updated and upgraded to the latest Debian 10 Buster release.

Regularly, we get the question if we have an image of our Raspberry Pi with some frameworks and our deep-learning examples. We are happy to comply with this request.


Installation.

  • Get a 16 GB SD card which will hold the image.
  • Download the image RPi_64OS_DNN.xz (2.68 GByte!) from Sync.
  • Flash the image on the SD card with the Imager or balenaEtcher.
  • Insert the SD card into your Raspberry Pi 4.
  • Wait a few minutes, while the image will expand to the full size of your SD card.
  • No WiFi installed. Password: 3.14
  • RPi_64OS_DNN.xz md5sum: c4c7b4e6571f690d4f6c156ca5df9444

Tips.

  • You can overclock the Raspberry Pi if your SD-card is not too worn out. 1800 MHz is no problem. Most deep learning examples even work at 1950 MHz.
  • If you are in need of extra space, you can delete the opencv and the opencv_contrib folder from the SD card. They are no longer needed since all libraries are placed in the /usr/local directory.

Contents.

Clicking on the links below will direct you to our GitHub repo.


Pre-installed frameworks.

Clicking on the links below will direct you to our installation guide.

output image


WiFi.

Since everyone has a unique password for their WiFi connection, we have not activated the WiFi.
To enable the wireless LAN to follow the next steps:

  1. Left-click on the Ethernet symbol.

    image

  2. Click "Turn on wireless LAN", and wait a few seconds. Your RPi will scan for available networks.

    image

  3. Left-click again on the Ethernet symbol and choose your network.

    image

  4. Give your key, and wait a couple of seconds to let the RPi establish the connection.

    image

  5. Success!

    image

OpenCV + TensorFlow.

Importing both TensorFlow and OpenCV in Python can throw the error: cannot allocate memory in static TLS block.
This behaviour only occurs on an aarch64 system and is caused by the OpenMP memory requirements not being met.
For more information, see GitHub ticket #14884.

output image

There are a few solutions. The easiest is to import OpenCV at the beginning, as shown above.
The other is disabling OpenMP by setting the -DBUILD_OPENMP and -DWITH_OPENMP flags OFF.
Where possible, OpenCV will now use the default pthread or the TBB engine for parallelization.
We don't recommend it. Not all OpenCV algorithms automatically switch to pthread.
Our advice is to import OpenCV into Python first before anything else.


paypal

rpi-image's People

Contributors

qengineering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rpi-image's Issues

install dlib error

Hi, your image helped me a lot in saving time.👍
By the way, I want to install the dlib library, but an error occurs. Do you know a solution?

I'm really sorry. I've tried all the methods on the internet, but I can't solve it, so I'm asking

Image for Jetson nano ?

@Qengineering

thank you for your awesome Rpi-image. Definitely, this will save many hours for beginners.

I would like to know Do you have a pre-configured image for the Jetson nano board as well?

please advise.

RPi Desktop version for Pi4 emulation?

Hey there,
Thank you for all the hard work you put into this and the documentation.
I'm trying to emulate my RPi4 on my windows 10 desktop and am wondering if is there a .iso version of this that I could run as a virtual machine using Hyper-V or VirtualBox? Should I try to do it the qemu way or find a way to convert your RPi_64OS_DNN.img to .iso then mount use virtualbox (worried the difference in arm and amd architectures for the compiled software)?

"ERROR: the system appears to be configured for the legacy camera stack"

Hello,

I wonder why tools like libcamera-hello do not work with the RPi-image. The libcamera-tools missing first, but I installed them with:

$ sudo apt install libcamera-apps

$ libcamera-hello 
ERROR: the system appears to be configured for the legacy camera stack

In raspi-config, the camera is enabled. I also gave the GPU 256 MB memory in raspi-config.

$ v4l2-ctl --list-devices
bcm2835-codec-decode (platform:bcm2835-codec):
	/dev/video10
	/dev/video11
	/dev/video12
	/dev/video18

bcm2835-isp (platform:bcm2835-isp):
	/dev/video13
	/dev/video14
	/dev/video15
	/dev/video16

mmal service 16.1 (platform:bcm2835-v4l2-0):
	/dev/video0

It tried using the RasPi Camera module v2 and the RasPi HQ Camera module. But this does not change anything.

Has anyone here observed the same issue and/or an idea how to solve it?

'output image' link is broken in ReadMe

The ReadMe has an 'output image' link right after the title. Unfortunately this link to a long cryptic string at https://camo.githubusercontent.com comes up 'not found'

I may have the image from a week or ago but was trying to rebuild on a clean OS (after i mucked around with lots of stuff and broke basic SSH among other things)

Need Bullseye v11

The new v11 Bullseye with proper 64bit has lots of upgrades
AND is very hard to get a working tensorflow-camera test running
it would be REALLY nice if y'all made an image with that OS and examples (python especially)

Neural Computer Stick

Hi, what would I need to additionally add to run/use an Intel Neural Compute Stick 2 with the Examples in this image?

Has anyone been able to get PiCamera (w/ MIDI CSI connection) to work around the 64bit incompatibility?

Shell commands like RASPISTILL and RASPIVID are unrecognized and pip3 install picamera fails because pip never finds a compatible version. I think there is a 32bit & 64bit incompatibility with the drivers and the way they use pointers for memory, not exactly sure but that's what I understood from this thread.

Has anyone figured out how I can make the raspberry pi camera work or know any work-arounds for the Qengineering 64bit Pi Image? I'm trying to use video capture for object detection. I've spent hours and days collecting my data, training my models, converting them to the right models and now I can't use the damn camera... fml

CV2 not listed on pip

hello, can someone please help

when I use this RPI-image on my Raspberry Pi 4B 8GB, I could import cv2 on python just fine
but when I wanted to install other packages with opencv-python as dependencies, the installation would fail when it tried to install opencv-python

tried 'pip3 show opencv-python' and 'pip3 list', no opencv-python package detected

Any kind of help would be greatly appreciated, thank you

install raspistill or libcamera

How to install raspistill or libcamera?
According to the official article, I encountered an error.

pi@raspberrypi:~/libcamera $ ninja -C build install
ninja: Entering directory `build'
[5/188] Compiling C++ object src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_gsl.cpp.o
FAILED: src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_gsl.cpp.o
c++ -Isrc/ipa/rkisp1/ipa_rkisp1.so.p -Isrc/ipa/rkisp1 -I../src/ipa/rkisp1 -Iinclude -I../include -Isrc/ipa -I../src/ipa -Iinclude/libcamera/ipa -Iinclude/libcamera -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++17 -O0 -g -Wl,--start-group -lstdc++fs -Wl,--end-group -Wshadow -include /home/pi/libcamera/build/config.h -fPIC -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_gsl.cpp.o -MF src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_gsl.cpp.o.d -o src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_gsl.cpp.o -c ../src/ipa/rkisp1/algorithms/gsl.cpp
In file included from ../include/libcamera/controls.h:11,
from ../src/ipa/libipa/algorithm.h:12,
from ../src/ipa/rkisp1/algorithms/algorithm.h:10,
from ../src/ipa/rkisp1/algorithms/gsl.h:10,
from ../src/ipa/rkisp1/algorithms/gsl.cpp:8:
/usr/include/c++/8/optional: In instantiation of ‘_Tp std::optional<_Tp>::value_or(_Up&&) && [with _Up = const libcamera::utils::details::defopt_t&; _Tp = std::vector]’:
../src/ipa/rkisp1/algorithms/gsl.cpp:63:71: required from here
/usr/include/c++/8/optional:1267:8: error: call of overloaded ‘vector(const libcamera::utils::details::defopt_t&)’ is ambiguous
: static_cast<_Tp>(std::forward<_Up>(__u));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/vector:64,
from ../include/libcamera/controls.h:16,
from ../src/ipa/libipa/algorithm.h:12,
from ../src/ipa/rkisp1/algorithms/algorithm.h:10,
from ../src/ipa/rkisp1/algorithms/gsl.h:10,
from ../src/ipa/rkisp1/algorithms/gsl.cpp:8:
/usr/include/c++/8/bits/stl_vector.h:515:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = short unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(initializer_list<value_type> __l,
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:476:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = short unsigned int; _Alloc = std::allocator]’
vector(vector&& __x) noexcept
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:458:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = short unsigned int; _Alloc = std::allocator]’
vector(const vector& __x)
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:415:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = short unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’ vector(size_type __n, const allocator_type& __a = allocator_type())
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:402:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = short unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
^~~~~~
[6/188] Compiling C++ object src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_lsc.cpp.o
FAILED: src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_lsc.cpp.o
c++ -Isrc/ipa/rkisp1/ipa_rkisp1.so.p -Isrc/ipa/rkisp1 -I../src/ipa/rkisp1 -Iinclude -I../include -Isrc/ipa -I../src/ipa -Iinclude/libcamera/ipa -Iinclude/libcamera -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Werror -std=c++17 -O0 -g -Wl,--start-group -lstdc++fs -Wl,--end-group -Wshadow -include /home/pi/libcamera/build/config.h -fPIC -DLIBCAMERA_BASE_PRIVATE -MD -MQ src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_lsc.cpp.o -MF src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_lsc.cpp.o.d -o src/ipa/rkisp1/ipa_rkisp1.so.p/algorithms_lsc.cpp.o -c ../src/ipa/rkisp1/algorithms/lsc.cpp
In file included from ../include/libcamera/controls.h:11,
from ../src/ipa/libipa/algorithm.h:12,
from ../src/ipa/rkisp1/algorithms/algorithm.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.cpp:8:
/usr/include/c++/8/optional: In instantiation of ‘_Tp std::optional<_Tp>::value_or(_Up&&) && [with _Up = const libcamera::utils::details::defopt_t&; _Tp = std::vector]’:
../src/ipa/rkisp1/algorithms/lsc.cpp:46:60: required from here
/usr/include/c++/8/optional:1267:8: error: call of overloaded ‘vector(const libcamera::utils::details::defopt_t&)’ is ambiguous
: static_cast<_Tp>(std::forward<_Up>(__u));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/vector:64,
from ../include/libcamera/controls.h:16,
from ../src/ipa/libipa/algorithm.h:12,
from ../src/ipa/rkisp1/algorithms/algorithm.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.cpp:8:
/usr/include/c++/8/bits/stl_vector.h:515:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = double; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(initializer_list<value_type> __l,
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:476:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = double; _Alloc = std::allocator]’
vector(vector&& __x) noexcept
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:458:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = double; _Alloc = std::allocator]’
vector(const vector& __x)
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:415:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = double; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(size_type __n, const allocator_type& __a = allocator_type())
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:402:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = double; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
^~~~~~
In file included from ../include/libcamera/controls.h:11,
from ../src/ipa/libipa/algorithm.h:12,
from ../src/ipa/rkisp1/algorithms/algorithm.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.cpp:8:
/usr/include/c++/8/optional: In instantiation of ‘_Tp std::optional<_Tp>::value_or(_Up&&) && [with _Up = const libcamera::utils::details::defopt_t&; _Tp = std::vector]’:
../src/ipa/rkisp1/algorithms/lsc.cpp:79:62: required from here
/usr/include/c++/8/optional:1267:8: error: call of overloaded ‘vector(const libcamera::utils::details::defopt_t&)’ is ambiguous
: static_cast<_Tp>(std::forward<_Up>(__u));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/8/vector:64,
from ../include/libcamera/controls.h:16,
from ../src/ipa/libipa/algorithm.h:12,
from ../src/ipa/rkisp1/algorithms/algorithm.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.h:10,
from ../src/ipa/rkisp1/algorithms/lsc.cpp:8:
/usr/include/c++/8/bits/stl_vector.h:515:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = short unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(initializer_list<value_type> __l,
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:476:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = short unsigned int; _Alloc = std::allocator]’
vector(vector&& __x) noexcept
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:458:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = short unsigned int; _Alloc = std::allocator]’
vector(const vector& __x)
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:415:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>::size_type, const allocator_type&) [with _Tp = short unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::size_type = long unsigned int; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’ vector(size_type __n, const allocator_type& __a = allocator_type())
^~~~~~
/usr/include/c++/8/bits/stl_vector.h:402:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = short unsigned int; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::allocator_type = std::allocator]’
vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
^~~~~~
[10/188] Compiling C++ object src/qcam/qcam.p/.._cam_options.cpp.o
ninja: build stopped: subcommand failed.

help updating ncnn benchmark data on raspberrypi

hi

The raspberrypi 4 data in ncnn benchmark is very old[0], and the latest ncnn is faster than before.

I've tested ncnn on raspberrypi 3b+ and got new benchmark data [1]

But I have no other raspberrypi devices for updating info.

Could you please help updating them ?

[0] https://github.com/Tencent/ncnn/blob/master/benchmark/README.md#raspberry-pi-4-model-b-broadcom-bcm2711b0-cortex-a72-armv8-15ghz-x-4
[1] https://github.com/Tencent/ncnn/blob/master/benchmark/README.md#raspberry-pi-3-model-b-broadcom-bcm2837b0-cortex-a53-armv8-14ghz-x-4

step 0 install 64bit os on devices

step 1 shutdown graphics stack

on Linux (with root)

init 3

or

systemctl isolate multi-user.target

on Android (with root)

adb root
adb shell stop

step 2 set cpu performance mode

on Linux / Android (with root)

echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo "performance" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
echo "performance" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
echo "performance" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor

step 3 git clone the latest ncnn source, build benchncnn, and run

git clone https://github.com/Tencent/ncnn.git
cd ncnn
mkdir build && cd build
cmake ..
make -j4 benchncnn

benchmark with 4 threads

./benchncnn 8 4 0 -1 1

benchmark with 1 thread

./benchncnn 4 1 0 -1 1

step 4 (optional) restore graphics stack

on Linux (with root)

init 5

or

systemctl isolate graphical.target

on Android (with root)

adb root
adb shell start

step 5 collect benchmark data and open pull request to ncnn project 😄

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.