Latest YouTube Video
Saturday, October 14, 2017
Anonymous google sites
from Google Alert - anonymous http://ift.tt/2wWQzH7
via IFTTT
Alcoholics anonymous 12 steps list
from Google Alert - anonymous http://ift.tt/2yoooE6
via IFTTT
College admissions predictions.
from Google Alert - anonymous http://ift.tt/2xFBIA3
via IFTTT
Anonymous user 729469
from Google Alert - anonymous http://ift.tt/2kOExOf
via IFTTT
Anonymous fox hack
from Google Alert - anonymous http://ift.tt/2xFeomh
via IFTTT
Anonymous tinder app
from Google Alert - anonymous http://ift.tt/2ymciJR
via IFTTT
Pay anonymously with paypal
from Google Alert - anonymous http://ift.tt/2ynTE6f
via IFTTT
cameron russell is sharing anonymous stories of models who have been sexually assaulted - iD
from Google Alert - anonymous http://ift.tt/2ggNA9a
via IFTTT
All Sky Steve
Ukraine Police Warns of New NotPetya-Style Large Scale CyberAttack
from The Hacker News http://ift.tt/2gjjUYV
via IFTTT
Friday, October 13, 2017
Flix Anonymous - Episode 44
from Google Alert - anonymous http://ift.tt/2xFaYVu
via IFTTT
St. Mary's Art Department Receives Anonymous Donation Of Equipment
from Google Alert - anonymous http://ift.tt/2ynpUqv
via IFTTT
Model shares anonymous stories of industry predators
from Google Alert - anonymous http://ift.tt/2ggnX8u
via IFTTT
Ravens: RB Terrance West and G Matt Skura out, DT Brandon Williams doubtful for Sunday vs. Bears (ESPN)
via IFTTT
Download anonymous survey responses
from Google Alert - anonymous http://ift.tt/2kMBIgG
via IFTTT
American Journal of Sexuality Education
from Google Alert - anonymous http://ift.tt/2xD3ylj
via IFTTT
[FD] [RCESEC-2017-002][CVE-2017-14956] AlienVault USM v5.4.2 "/ossim/report/wizard_email.php" Cross-Site Request Forgery leading to Sensitive Information Disclosure
Source: Gmail -> IFTTT-> Blogger
[FD] Multiple vulnerabilities in OpenText Documentum Content Server
Source: Gmail -> IFTTT-> Blogger
[FD] Advisory X41-2017-008: Multiple Vulnerabilities in Shadowsocks
Source: Gmail -> IFTTT-> Blogger
New Ransomware Not Just Encrypts Your Android But Also Changes PIN Lock
from The Hacker News http://ift.tt/2g8GRup
via IFTTT
Ravens: Jimmy Smith (Achilles) returns to practice after missing last two days (ESPN)
via IFTTT
Anonymous Outer Identity non-determinisim - eduroam
from Google Alert - anonymous http://ift.tt/2g6uheQ
via IFTTT
ISS Daily Summary Report – 10/12/2017
from ISS On-Orbit Status Report http://ift.tt/2yhIApb
via IFTTT
Anonymous Ltd
from Google Alert - anonymous http://ift.tt/2yI3hhi
via IFTTT
Scam Alert: Your Trusted Friends Can Hack Your Facebook Account
from The Hacker News http://ift.tt/2xDw1rh
via IFTTT
Thursday, October 12, 2017
Priority: Anonymous & Moderated Marking
from Google Alert - anonymous http://ift.tt/2wS13HC
via IFTTT
8th Street, Ocean City, MD's surf is at least 5.15ft high
8th Street, Ocean City, MD Summary
At 4:00 AM, surf min of 6.04ft. At 10:00 AM, surf min of 5.51ft. At 4:00 PM, surf min of 5.11ft. At 10:00 PM, surf min of 5.15ft.
Surf maximum: 5.8ft (1.77m)
Surf minimum: 5.15ft (1.57m)
Tide height: 0.41ft (0.12m)
Wind direction: S
Wind speed: 10.17 KTS
from Surfline http://ift.tt/1kVmigH
via IFTTT
Alcoholics Anonymous symbol (AA)
from Google Alert - anonymous http://ift.tt/2xAPvgh
via IFTTT
How do I iteratively fill a large matrix within an anonymous function?
from Google Alert - anonymous http://ift.tt/2xDqpgC
via IFTTT
Anonymous access
from Google Alert - anonymous http://ift.tt/2yhkknu
via IFTTT
How to Be Even More Anonymous Online
from Google Alert - anonymous http://ift.tt/2z3UYZi
via IFTTT
ISS Daily Summary Report – 10/11/2017
from ISS On-Orbit Status Report http://ift.tt/2ye9OiU
via IFTTT
I have a new follower on Twitter
VIVA Holdings
VIVA - The future of finance & your financial future. VIVA Crowns = Business License. Get yours at https://t.co/AyhF9ijlGU #cryptocurrency #FinTech #VIVAconomy
https://t.co/fV6gJD7J2v
Following: 2382 - Followers: 2881
October 12, 2017 at 10:46AM via Twitter http://twitter.com/viva_coin
Online Training for CISA, CISM, and CISSP Cyber Security Certifications
from The Hacker News http://ift.tt/2qES9hy
via IFTTT
MS Office Built-in Feature Allows Malware Execution Without Macros Enabled
from The Hacker News http://ift.tt/2gxnKdZ
via IFTTT
Buggy Microsoft Outlook Sending Encrypted S/MIME Emails With Plaintext Copy For Months
from The Hacker News http://ift.tt/2gz84qw
via IFTTT
NGC 1365: Majestic Island Universe
Wednesday, October 11, 2017
Anonymous downloads are no longer supported
from Google Alert - anonymous http://ift.tt/2z1wAr0
via IFTTT
Online tool for anonymous agricultural complaints
from Google Alert - anonymous http://ift.tt/2zgNcfz
via IFTTT
Drexel Caves to Anonymous Internet Trolls, Places Tenured Professor on Administrative Leave
from Google Alert - anonymous http://ift.tt/2i4gLgb
via IFTTT
Anonymous user 6fc542
from Google Alert - anonymous http://ift.tt/2i3PdYj
via IFTTT
Lisa (Century Meeting)
from Google Alert - anonymous http://ift.tt/2kHi2e0
via IFTTT
Staying Anonymous on the Blockchain: Concerns and Techniques
from Google Alert - anonymous http://ift.tt/2g1LXbG
via IFTTT
ISS Daily Summary Report – 10/10/2017
from ISS On-Orbit Status Report http://ift.tt/2wO6PtW
via IFTTT
Israel Hacked Kaspersky, Caught Russian Spies Hacking American Spies, But...
from The Hacker News http://ift.tt/2yfNF3r
via IFTTT
Kitchen Porter
from Google Alert - anonymous http://ift.tt/2yECa6F
via IFTTT
Hackers Steal $60 Million from Taiwanese Bank; Two Suspects Arrested
from The Hacker News http://ift.tt/2i2pijE
via IFTTT
Microsoft Issues Patches For Severe Flaws, Including Office Zero-Day & DNS Attack
from The Hacker News http://ift.tt/2wNHLCY
via IFTTT
EFS-to-EFS Backup Solution
from Google Alert - anonymous http://ift.tt/2y9Dzla
via IFTTT
[InsideNothing] jeffreydhairston liked your post "[FD] Kajona 4.7: XSS & Directory Traversal"
|
Source: Gmail -> IFTTT-> Blogger
[InsideNothing] jeffreydhairston liked your post "[InsideNothing] charlesdoliver liked your post "[InsideNothing] Web Development liked your post "[InsideNothing] hitebook.net liked your post "[FD] Kajona 4.7: XSS & Directory Traversal""""
|
Source: Gmail -> IFTTT-> Blogger
Star Cluster NGC 362 from Hubble
Tuesday, October 10, 2017
Anonymous - Executive Chef/Kitchen Manager
from Google Alert - anonymous http://ift.tt/2y9UIsz
via IFTTT
Bulk extract of anonymous activity
from Google Alert - anonymous http://ift.tt/2wMtEy7
via IFTTT
OnePlus Secretly Collects Way More Data Than It Should — Here’s How to Disable It
from The Hacker News http://ift.tt/2xv9m0q
via IFTTT
Report: Anonymous location tracking proves difficult for individual privacy
from Google Alert - anonymous http://ift.tt/2hZLPhc
via IFTTT
Watch Out! Difficult-to-Detect Phishing Attack Can Steal Your Apple ID Password
from The Hacker News http://ift.tt/2y91WPI
via IFTTT
[FD] OpenText Document Sciences xPression (formerly EMC Document Sciences xPression) - SQL Injection
Source: Gmail -> IFTTT-> Blogger
[FD] SSD Advisory – Vacron NVR Remote Command Execution
Source: Gmail -> IFTTT-> Blogger
Re: [FD] SmartBear SoapUI - Remote Code Execution via Deserialization
Source: Gmail -> IFTTT-> Blogger
[FD] ArcGIS Server 10.3.1: RMIClassLoader useCodebaseOnly=false RCE
Source: Gmail -> IFTTT-> Blogger
[FD] DefenseCode ThunderScan SAST Advisory: WordPress Ad Widget Plugin Local File Inclusion Security Vulnerability
Source: Gmail -> IFTTT-> Blogger
Microsoft Cortana Can Now Read Your Skype Messages to Make Chat Smarter
from The Hacker News http://ift.tt/2xwytLk
via IFTTT
📈 Ravens rise 4 spots to No. 18 in Week 6 NFL Power Rankings (ESPN)
via IFTTT
Brazilian politician: “Freedom of expression is guaranteed, but it cannot be anonymous”
from Google Alert - anonymous http://ift.tt/2kBiI4F
via IFTTT
ISS Daily Summary Report – 10/09/2017
from ISS On-Orbit Status Report http://ift.tt/2i1Xko5
via IFTTT
Warning: Millions Of P0rnHub Users Hit With Malvertising Attack
from The Hacker News http://ift.tt/2y9SDwQ
via IFTTT
anonymous.b6b480
from Google Alert - anonymous http://ift.tt/2i0yrJA
via IFTTT
PitchBook Review: Inaccurate data by Anonymous Reviewer
from Google Alert - anonymous http://ift.tt/2hYXywj
via IFTTT
Monday, October 9, 2017
Anonymous Interviews Dissertation Proposal Example – 647444
from Google Alert - anonymous http://ift.tt/2g6zIy8
via IFTTT
Alcohols anonymous in Punta Cana
from Google Alert - anonymous http://ift.tt/2xvinl7
via IFTTT
Seg. 1) Anonymous
from Google Alert - anonymous http://ift.tt/2kC8sZI
via IFTTT
Christine Hewitt, CFAX Santas Anonymous
from Google Alert - anonymous http://ift.tt/2gou1bQ
via IFTTT
The influence of anonymous peers on prosocial behavior
from Google Alert - anonymous http://ift.tt/2gpKCfv
via IFTTT
Optimizing OpenCV on the Raspberry Pi
This tutorial is meant for advanced Raspberry Pi users who are looking to milk every last bit of performance out of their Pi for computer vision and image processing using OpenCV.
I’ll be assuming:
- You have worked through my previous Raspberry Pi + OpenCV install tutorials (ideally multiple times).
- You are comfortable with the command line and Unix environments.
Since this is an advanced guide, I’ll be doing less hand holding and instead focusing on the optimizations themselves. If you get stuck or run into an error, you’ll need to refer back to the previous tutorials I offer here on PyImageSearch.
By the time you finish this tutorial, your Raspberry Pi will enjoy a 30% speed increase when executing OpenCV and Python scripts.
To learn more about optimizing OpenCV on your Raspberry Pi, just keep reading.
Looking for the source code to this post?
Jump right to the downloads section.
Optimizing OpenCV on the Raspberry Pi
A couple weeks ago I demonstrated how to deploy a deep neural network to your Raspberry Pi.
The results were satisfactory, taking approximately 1.7 seconds to classify an image using GoogLeNet and 0.9 seconds for SqueezeNet, respectively.
However, I was left wondering if we could do better.
While we cannot train neural networks on the Raspberry Pi, we can deploy pre-trained networks to our Pi — provided we can optimize the Raspberry Pi sufficiently (and the network can fit into the limited memory of the Pi hardware).
In the remainder of this tutorial, we will discuss the optimizations we will leverage during our OpenCV installation, followed by walking through the seven installation steps.
After our optimized OpenCV compile is installed, we’ll run a few quick tests determine if our new OpenCV install is faster than the previous one.
My goal here to demonstrate that the optimizations are in fact much faster on the Raspberry Pi 3 and you should not hesitate to use them in your own projects.
NEON and FVPV3
In my research on how to optimize the Raspberry Pi for OpenCV I came across this excellent article by Sagi Zeevi.
Inside the tutorial Sagi recommends using:
- NEON
- VFPV3
- And optionally Threading Building Blocks (TBB)
I’m not a big fan of TBB as (1) the performance gains are meager and (2) they are a royal pain in the ass to install on the Raspberry Pi.
The most bang for your buck is going to come from NEON and VFPV3.
ARM NEON is an optimization architecture extension for ARM processors. It was designed by the ARM engineers specifically for faster video processing, image processing, speech recognition, and machine learning. This optimization supports Single Instruction Multiple Data (SIMD) (as opposed to SISD, MISD, MIMD), which describes an architecture where multiple processing elements in the pipeline perform operations on multiple data points (hardware) all executed with a single instruction.
The ARM engineers also built VFPV3, a floating point optimization, into the chip our Raspberry Pi 3’s use. The ARM page linked here describes features included in this optimization such as configurable rounding modes and customizable default not a number (NaN) behavior.
What this means for us is that our neural network is likely to run faster because the ARM processor on the Raspberry Pi 3 has hardware optimizations that we can take advantage of with the 4× ARM Cortex-A53, 1.2GHz processor.
I think you’ll be really impressed with the results, so let’s go ahead and get your optimized OpenCV installed on the Raspberry Pi.
Step #1: Expand filesystem and reclaim space
For the remainder of this tutorial I’ll be making the following assumptions:
- You are working with a brand new, fresh install of Raspbian Stretch.
- This is not the first time you have installed OpenCV on the Raspberry Pi using Python virtual environments. If it is, please get your feet wet using one of my introductory OpenCV install guides.
- You are comfortable with the command line and Unix environments.
- You know how to debug CMake output for common errors (Python virtual environment not found, missing Python libraries, etc.).
Again, this tutorial is an advanced guide so I’ll presenting the commands and only providing an explanation if it is pertinent — by and large, you should know what these commands do before you execute them.
The first step is to run,
raspi-configand expand your filesystem:
$ sudo raspi-config
And then reboot your Raspberry Pi:
$ sudo reboot
From there, delete both Wolfram Engine and LibreOffice to reclaim ~1GB of space on your Raspberry Pi:
$ sudo apt-get purge wolfram-engine $ sudo apt-get purge libreoffice* $ sudo apt-get clean $ sudo apt-get autoremove
Step #2: Install dependencies
The following commands will update and upgrade any existing packages, followed by installing dependencies, I/O libraries, and optimization packages for OpenCV:
$ sudo apt-get update && sudo apt-get upgrade $ sudo apt-get install build-essential cmake pkg-config $ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev $ sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev $ sudo apt-get install libxvidcore-dev libx264-dev $ sudo apt-get install libgtk2.0-dev libgtk-3-dev $ sudo apt-get install libcanberra-gtk* $ sudo apt-get install libatlas-base-dev gfortran $ sudo apt-get install python2.7-dev python3-dev
This entire process should take about 5 minutes.
Note: I added
libcanberra-gtk*which grabs the ARM specific GTK to prevent GTK warnings (not errors; warnings) you may encounter when running Python + OpenCV scripts on the Raspberry Pi.
Step #3: Download the OpenCV source code
Next, download the OpenCV source code for both the opencv and opencv_contrib repositories, followed by unarchiving them:
$ cd ~ $ wget -O opencv.zip http://ift.tt/2x4vwWB $ unzip opencv.zip $ wget -O opencv_contrib.zip http://ift.tt/2xIPYcC $ unzip opencv_contrib.zip
Note: You will need to click the “<=>” button in the toolbar of the codeblock above to grab the full paths to the zip archives.
For this blog post, we’ll be using OpenCV 3.3; however, as newer versions of OpenCV are released you can update the corresponding version numbers.
Step #4: Create your Python virtual environment and install NumPy
We’ll be using Python virtual environments, a best practice when working with Python.
You can install pip, virtualenv, and virtualenvwrapper using the following commands:
$ wget http://ift.tt/1mn7OFn $ sudo python get-pip.py $ sudo python3 get-pip.py $ sudo pip install virtualenv virtualenvwrapper $ sudo rm -rf ~/.cache/pip
Once both
virtualenvand
virtualenvwrapperhave been installed, open up your
~/.profileand append the following lines to the bottom of the file, using your favorite terminal-based text editor such as
vim,
emacs, or
nano:
# virtualenv and virtualenvwrapper export WORKON_HOME=$HOME/.virtualenvs source /usr/local/bin/virtualenvwrapper.sh
From there, reload your
~/.profilefile to apply the changes to your current bash session:
$ source ~/.profile
You’ll need to run
source ~/.profileeach time you open a new terminal/SSH into your Pi to ensure your system variables have been set properly (it also loads this file on boot).
Next, create your Python 3 virtual environment:
$ mkvirtualenv cv -p python3
Here I am creating a Python virtual environment named
cvusing Python 3 (alternatively, you may also use Python 2.7 by changing the
-pswitch to
python2).
You can name the virtual environment whatever you want, but I use
cvas the standard naming convention here on PyImageSearch.
Finally, install NumPy into the Python virtual environment:
$ pip install numpy
Step #5: Compile and install the optimized OpenCV library for Raspberry Pi
We’re now ready to compile and install the optimized version of Raspberry Pi.
Ensure you are in the
cvvirtual environment using the
workoncommand:
$ workon cv
And from there configure your build:
$ cd ~/opencv-3.3.0/ $ mkdir build $ cd build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.3.0/modules \ -D ENABLE_NEON=ON \ -D ENABLE_VFPV3=ON \ -D BUILD_TESTS=OFF \ -D INSTALL_PYTHON_EXAMPLES=OFF \ -D BUILD_EXAMPLES=OFF ..
Notice how the NEON and VFPV3 flags have been enabled.
If you’re using Python 2.7, your “Python 2” section should look like this:
Otherwise, if you’re compiling OpenCV for Python 3, check the “Python 3” output of CMake:
Notice how the
Interpreter,
Libraries,
numpy, and
packages pathvariables have been properly set.
Before you start the compile I would suggest increasing your swap space. This will enable you to compile OpenCV with all four cores of the Raspberry Pi without the compile hanging due to memory exhausting.
Open up your
/etc/dphys-swapfilefile and then edit the
CONF_SWAPSIZEvariable:
# set size to absolute value, leaving empty (default) then uses computed value # you most likely don't want this, unless you have an special disk situation # CONF_SWAPSIZE=100 CONF_SWAPSIZE=1024
Notice that I’m increasing the swap from 100MB to 1024MB. This is the secret sauce to compiling OpenCV with multiple cores on the Raspbian Stretch.
If you do not perform this step it’s very likely that your Pi will hang.
From there, restart the swap service:
$ sudo /etc/init.d/dphys-swapfile stop $ sudo /etc/init.d/dphys-swapfile start
Note: Increasing swap size is a great way to burn out your Raspberry Pi microSD card. Flash-based storage have limited number of writes you can perform until the card is essentially unable to hold the 1’s and 0’s anymore. We’ll only be enabling large swap for a short period of time, so it’s not a big deal. Regardless, be sure to backup your
.imgfile after installing OpenCV + Python just in case your card dies unexpectedly early. You can read more about large swap sizes corrupting memory cards on this page.
Now that we’ve updated the swap size, kick off the optimized OpenCV compile using all four cores:
$ make -j4
Assuming OpenCV compiled without error (as in my screenshot above), you can install your optimized version of OpenCV on your Raspberry Pi:
$ sudo make install $ sudo ldconfig
Don’t forget to go back to your
/etc/dphys-swapfilefile and:
- Reset
CONF_SWAPSIZE
to 100MB. - Restart the swap service.
Step #6: Finish installing your optimized OpenCV on the Raspberry Pi
If you compiled OpenCV for Python 3, you need to issue the following commands to sym-link the
cv2.sobindings into your
cvvirtual environment:
$ cd /usr/local/lib/python3.5/site-packages/ $ sudo mv cv2.cpython-35m-arm-linux-gnueabihf.so cv2.so $ cd ~/.virtualenvs/cv/lib/python3.5/site-packages/ $ ln -s /usr/local/lib/python3.5/site-packages/cv2.so cv2.so
Keep in mind that the exact paths will need to be updated depending if you are using Python 3.4, Python 3.5, Python 3.6, etc.
If you instead compiled OpenCV for Python 2.7, you can use these commands to sym-link your
cv2.sofile into the
cvvirtual environment:
$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/ $ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so
Step 7: Testing your optimized OpenCV + Raspberry Pi install
As a quick sanity check, access the
cvvirtual environment, fire up a Python shell and try to import the OpenCV library:
$ source ~/.profile $ workon cv $ python >>> import cv2 >>> cv2.__version__ '3.3.0' >>>
Congratulations! You’ve just installed an optimized OpenCV 3.3 on your Raspberry Pi 3.
So, how good are these optimizations?
After working through this tutorial you’re probably curious how good these OpenCV + Raspberry Pi optimizations are.
Given that we just optimized for floating point operations a great test would be to run a pre-trained deep neural network on the Raspberry Pi, similar to what we did last week.
Go ahead and use the “Downloads” section of this blog post to download our pre-trained Convolutional Neural Networks + example images + classification script.
From there, fire up a shell and execute the following command:
$ python pi_deep_learning.py --prototxt models/bvlc_googlenet.prototxt \ --model models/bvlc_googlenet.caffemodel --labels synset_words.txt \ --image images/barbershop.png [INFO] loading model... [INFO] classification took 0.87173 seconds [INFO] 1. label: barbershop, probability: 0.78055 [INFO] 2. label: barber chair, probability: 0.2194 [INFO] 3. label: rocking chair, probability: 3.4663e-05 [INFO] 4. label: restaurant, probability: 3.7258e-06 [INFO] 5. label: hair spray, probability: 1.4715e-06
Here you can see that GoogLeNet classified our image in 0.87 seconds, which is a massive 48.82% improvement from last week’s 1.7 seconds.
Let’s give SqueezeNet a try:
$ python pi_deep_learning.py --prototxt models/squeezenet_v1.0.prototxt \ --model models/squeezenet_v1.0.caffemodel --labels synset_words.txt \ --image images/barbershop.png [INFO] loading model... [INFO] classification took 0.4777 seconds [INFO] 1. label: barbershop, probability: 0.80578 [INFO] 2. label: barber chair, probability: 0.15124 [INFO] 3. label: half track, probability: 0.0052872 [INFO] 4. label: restaurant, probability: 0.0040124 [INFO] 5. label: desktop computer, probability: 0.0033352
Here we can see that SqueezeNet correctly classified the input image in 0.47 seconds, another huge improvement from the 0.9 seconds from last week (47.78%).
Based on our results, it’s very clear that our OpenCV optimizations have made a significant impact.
Summary
In today’s blog post, you learned how to optimize your OpenCV install on the Raspberry Pi.
These optimizations came from updating our CMake command to include NEON and VFPV3. When benchmarking OpenCV this leads to an approximate 30% increase in speed. However, when applied strictly to the new
dnnmodule in OpenCV 3, we are seeing an increase of over 48%!
I hope you enjoyed this tutorial and enjoy your optimized OpenCV + Raspberry Pi!
But before you go…
Be sure to check out other Raspberry Pi posts on my blog, and consider entering your email address in the form below to be notified when future deep learning/Raspberry Pi posts are published here on PyImageSearch.
Downloads:
The post Optimizing OpenCV on the Raspberry Pi appeared first on PyImageSearch.
from PyImageSearch http://ift.tt/2gnVMRZ
via IFTTT