<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error with the security-cam example under the ncappzoo in Intel® Distribution of OpenVINO™ Toolkit</title>
    <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656383#M2675</link>
    <description>&lt;P&gt;@chicagobob123 I can now see that you've done more or less the same as I did over on another thread.  Great minds think alike :)&lt;/P&gt;</description>
    <pubDate>Wed, 08 Aug 2018 17:08:01 GMT</pubDate>
    <dc:creator>idata</dc:creator>
    <dc:date>2018-08-08T17:08:01Z</dc:date>
    <item>
      <title>Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656373#M2665</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am struggling to run the &lt;A href="https://github.com/movidius/ncappzoo/blob/master/apps/security-cam/security-picam.py" target="_self"&gt;&lt;/A&gt;&lt;A href="http://security-picam.py"&gt;security-picam.py&lt;/A&gt; example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I am getting is "AttributeError: 'numpy.ndarray' object has no attribute 'show'".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that when I comment out the offending line (137) then I get the screenshots appearing in the _capture_ directory.  But no annotated video appears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using a Raspberry Pi 3 B+, a Pi Cam and version 1 of the SDK. The is running in a terminal on the Raspian Desktop. Note that the &lt;A href="https://github.com/movidius/ncappzoo/blob/master/apps/security-cam/security-cam.py" target="_self"&gt;&lt;/A&gt;&lt;A href="http://security-cam.py"&gt;security-cam.py&lt;/A&gt; example runs fine on my Ubuntu machine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions for how to fix this? I just want to get this running with a Pi Camera :smile: &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Mark</description>
      <pubDate>Tue, 31 Jul 2018 04:26:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656373#M2665</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-07-31T04:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656374#M2666</link>
      <description>&lt;P&gt;@MarkWest1972 , good catch! I developed &lt;A href="http://security-picam.py"&gt;security-picam.py&lt;/A&gt; on, and have always run on a headless system, so I didn't run into this issue. I am unable to get to this code immediately, but try rerunning the code after commenting out lines &lt;A href="https://github.com/movidius/ncappzoo/blob/master/apps/security-cam/security-picam.py#L136" target="_self"&gt;136&lt;/A&gt; and &lt;A href="https://github.com/movidius/ncappzoo/blob/master/apps/security-cam/security-picam.py#L137" target="_self"&gt;137&lt;/A&gt;. This should let the script run, but the results won't be visualized on the display.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Based on the error you are reporting, I suspect that the issue happens when there are zero detection, which is when &lt;CODE&gt;img&lt;/CODE&gt; is a numpy array as against an image object. Try converting &lt;CODE&gt;img&lt;/CODE&gt; to an image object after line &lt;A href="https://github.com/movidius/ncappzoo/blob/master/apps/security-cam/security-picam.py#L86" target="_self"&gt;86&lt;/A&gt; and before line &lt;A href="https://github.com/movidius/ncappzoo/blob/master/apps/security-cam/security-picam.py#L100" target="_self"&gt;100&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 05:22:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656374#M2666</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-07-31T05:22:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656375#M2667</link>
      <description>&lt;P&gt;Thanks for your reply!  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your assumption seems to be correct.  Converting _img_ to an _PIL.Image.Image_ object removes the error, but there is still no image displayed in the Raspian desktop…&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 13:40:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656375#M2667</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-07-31T13:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656376#M2668</link>
      <description>&lt;P&gt;Additional information - after some googling I installed ImageMagick. Now the show() command works, but instead of a real time video I get lots of snapshots popping up on my desktop. All I want is the same behavior as shown by the &lt;A href="http://security-cam.py"&gt;security-cam.py&lt;/A&gt; example when I run on my ubuntu machine….&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 14:15:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656376#M2668</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-07-31T14:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656377#M2669</link>
      <description>&lt;P&gt;I've come to the conclusion that I need to instal OpenCV and fix this.  I'll post back here when I have a working solution :)&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 19:07:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656377#M2669</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-06T19:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656378#M2670</link>
      <description>&lt;P&gt;FYI it works great. Best example in the entire bunch. &lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 22:35:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656378#M2670</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-06T22:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656379#M2671</link>
      <description>&lt;P&gt;Oh I agree with you 100% @chicagobob123 - it's a great example! Apologies to @AshwinVijayakumar if I came across as negative!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My only issue is that the Pi Camera version doesn't display the annotated images as a video when running in the Raspian Desktop.  This isn't really needed functionality, but it would be nice to compare with the USB camera version for performance and so on. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway I'm working on fixing this (I just need a free evening). As soon as I do I'll post the results here.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 16:44:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656379#M2671</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-07T16:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656380#M2672</link>
      <description>&lt;P&gt;I will let you in on something I found out while working on this. The Web camera performs better because the GPU to memory on the PI is slow. The Pi Cam goes to the GPU memory then comes to the system memory you modify it and send it back. The USB comes into system memory then you modify it then you send it back to be displayed in GPU. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;That's roughly what I have seen and found out.</description>
      <pubDate>Tue, 07 Aug 2018 23:05:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656380#M2672</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-07T23:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656381#M2673</link>
      <description>&lt;P&gt;@chicagobob123 Very interesting!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I got the annotated video display running with a Pi Camera and this seems to confirm what you are saying.  &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;How I did it&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I made sure that OpenCV was installed on the Pi, along with the relevant dependancies&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My installation of the NCS SDK is API only (and version 1) so I didn't have OpenCV installed.  Building from source is a pain on the PI so I elected to install a pre-compiled version.  This took around 5 minutes or so.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;sudo apt-get install python-opencv
sudo pip3 install opencv-python==3.3.0.10
sudo apt-get install libjasper-dev
sudo apt-get install libqtgui4
sudo apt-get install libqt4-test
&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I made a copy of the &lt;A href="http://security-cam.py"&gt;security-cam.py&lt;/A&gt; file and replaced it's main function with the following code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;def main():

    device = open_ncs_device()
    graph = load_graph( device )

    # Main loop: Capture live stream &amp;amp; send frames to NCS
    with picamera.PiCamera() as camera:
        with picamera.array.PiRGBArray( camera ) as frame:
            while( True ):
                camera.resolution = ( 640, 480 )
                camera.capture( frame, ARGS.colormode, use_video_port=True )
                img = pre_process_image( frame.array )
                infer_image( graph, img, frame.array )

                # Clear PiRGBArray, so you can re-use it for next capture
                frame.seek( 0 )
                frame.truncate()

                # Display the frame for 5ms, and close the window so that the next
                # frame can be displayed. Close the window if 'q' or 'Q' is pressed.
                if( cv2.waitKey( 5 ) &amp;amp; 0xFF == ord( 'q' ) ):
                    break

    close_ncs_device( device, graph )
&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally I added the following import statements to the head of the new file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;import picamera
import picamera.array
&lt;/CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The resulting file is a combination of the code from the existing &lt;A href="http://security-cam.py"&gt;security-cam.py&lt;/A&gt; and &lt;A href="http://security-picam.py"&gt;security-picam.py&lt;/A&gt; files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the new file results in the annotated video being displayed, albeit at a seemingly slower rate than the USB camera version. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note that I'm not an expert in using the Pi Camera so it might be possible to tune this for better performance. YMMV :)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT : Added missing instructions to add import statements.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 15:37:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656381#M2673</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-08T15:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656382#M2674</link>
      <description>&lt;P&gt;One more thing : I see also that all code using the 'camera' variable APART FROM THAT IN THE MAIN METHOD can also be removed from the new file, as this code is no longer required. &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT : Added text in bold.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 16:03:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656382#M2674</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-08T16:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656383#M2675</link>
      <description>&lt;P&gt;@chicagobob123 I can now see that you've done more or less the same as I did over on another thread.  Great minds think alike :)&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 17:08:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656383#M2675</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-08T17:08:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656384#M2676</link>
      <description>&lt;P&gt;In case it is of interest to anyone reading this thread, I'm getting around 5 FPS with a Raspberry Pi Camera by using the &lt;A href="https://github.com/jrosebr1/imutils" target="_self"&gt;imutils&lt;/A&gt; library (and specifically the &lt;A href="https://github.com/jrosebr1/imutils/blob/master/imutils/video/videostream.py" target="_self"&gt;VideoStream&lt;/A&gt; class) for handling the video stream.  This class also allows one to easily switch between a USB and Raspberry Pi Camera.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From what I can tell the improvement is due to threading.  More information is available &lt;A href="https://www.pyimagesearch.com/2016/01/04/unifying-picamera-and-cv2-videocapture-into-a-single-class-with-opencv/" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 20:01:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656384#M2676</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-08T20:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656385#M2677</link>
      <description>&lt;P&gt;5 fps at 640x480 or 320x240?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 22:55:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656385#M2677</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-08T22:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656386#M2678</link>
      <description>&lt;P&gt;Here's a quick benchmark I did with 640x480:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_USB_&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Non Threaded: 4.48 FPS&lt;P&gt;&amp;nbsp;&lt;/P&gt;Threaded: 4.82 FPS&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_PiCam_ &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Non Threaded: 1.4 FPS&lt;P&gt;&amp;nbsp;&lt;/P&gt;Threaded: 4.15 FPS&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At 320x240 I got 5.13 FPS with the Raspberry Pi Camera by using threading!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2018 17:10:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656386#M2678</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-09T17:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656387#M2679</link>
      <description>&lt;P&gt;Those numbers look a little quicker than I got.  I think I was averaging about 3.x fps @640x480&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;using the Pi Cam. I did not try the web cam because I was confined by form factor. &lt;P&gt;&amp;nbsp;&lt;/P&gt;Wanted something small and compact.</description>
      <pubDate>Fri, 10 Aug 2018 02:29:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656387#M2679</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-10T02:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656388#M2680</link>
      <description>&lt;P&gt;Did you try threading? If not, it might help.  Good luck in any case!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One last thing - how did you work out the reason for the difference in USB vs PiCam performance? Is there a blog post or article out there somewhere?  I'm thinking about writing up my experiences…&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 12:46:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656388#M2680</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-10T12:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Error with the security-cam example under the ncappzoo</title>
      <link>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656389#M2681</link>
      <description>&lt;P&gt;There was a post someplace in the PI forums where they spilled the beans on how it worked. Pi Camera going to GPU mem and USB going to basic memory. It was telling.  I am going to switch hardware platforms.  Latte Panda or something that has more get go..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;when I can actually successfully RE-TRAIN a InceptionV3 network and use it on the stick. So far no such luck.</description>
      <pubDate>Fri, 10 Aug 2018 21:21:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Error-with-the-security-cam-example-under-the-ncappzoo/m-p/656389#M2681</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-08-10T21:21:10Z</dc:date>
    </item>
  </channel>
</rss>

