Coder Social home page Coder Social logo

yoloncs's Introduction

YOLO for Intel/Movidius Neural Compute Stick (NCS)

News

  • Camera App is working.
  • YOLOv1 Tiny is working.

Protobuf Model files

./prototxt/

Download Pretrained Caffe Models to ./weights/

Compilation

  • Compile .prototxt and corresponding .caffemodel (with the same name) to get NCS graph file. For example: "mvNCCompile prototxt/yolo_tiny_deploy.prototxt -w weights/yolo_tiny_deploy.caffemodel -s 12"
  • The compiled binary file "graph" has to be in main folder after this step.

Single Image Script

  • Run "yolo_example.py" to process a single image. For example: "python3 py_examples/yolo_example.py images/dog.jpg" to get detections as below.

Camera Input Script

  • Run "object_detection_app.py" to process a videos from your camera. For example: "python3 py_examples/object_detection_app.py" to get camera detections as below.
  • Modify script arguments if needed.
  • Press "q" to exit app.

yoloncs's People

Contributors

gudovskiy avatar gudovskiyd 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  avatar  avatar  avatar

yoloncs's Issues

Where is the TinyYOLO Model/Weights from?

Hey there,

I noticed there is a difference between this repo's TinyYOLO model (yolo_tiny_deploy.prototxt) and the one generated by the code create_yolo_prototxt.py (i.e. the yolo_tiny_deploy.prototxt at xingwangsfu). May I ask where this repo's TinyYOLO model comes from and how can I train it?

Thank you and appreciate your help!

py_examples error

Hi Everyone
I am getting error like below , could you please help me? Camera light is on and I installed OPENCV that was explained in 'http://milq.github.io/install-opencv-ubuntu-debian/' with OPTION 2. All examples work fine but I am still getting error like below. (ValueError: cannot reshape array of size 16922 into shape (7,7,2,4) this line looks like in trouble but I dont know how I can solve.)

[DEBUG/MainProcess] created semlock with handle 140701902925824
[DEBUG/MainProcess] created semlock with handle 140701902921728
[DEBUG/MainProcess] created semlock with handle 140701902917632
[DEBUG/MainProcess] Queue._after_fork()
[DEBUG/MainProcess] created semlock with handle 140701902913536
[DEBUG/MainProcess] created semlock with handle 140701902909440
[DEBUG/MainProcess] created semlock with handle 140701902905344
[DEBUG/MainProcess] Queue._after_fork()
Found stale device, resetting
Device 0 Address: 1.3.3 - VID/PID 03e7:2150
Starting wait for connect with 2000ms timeout
Found Address: 1.3.3 - VID/PID 03e7:2150
Found EP 0x81 : max packet size is 512 bytes
Found EP 0x01 : max packet size is 512 bytes
Found and opened device
Performing bulk write of 865724 bytes...
Successfully sent 865724 bytes of data in 214.364144 ms (3.851478 MB/s)
Boot successful, device address 1.3.3
Found Address: 1.3.3 - VID/PID 03e7:f63b
done
Booted 1.3.3 -> VSC
[DEBUG/MainProcess] created semlock with handle 140701902901248
[DEBUG/MainProcess] created semlock with handle 140701902897152
[DEBUG/MainProcess] created semlock with handle 140701902893056
[DEBUG/MainProcess] created semlock with handle 140701902888960
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-1] Queue._after_fork()
[DEBUG/ForkPoolWorker-1] Queue._after_fork()
[INFO/ForkPoolWorker-1] child process calling self.run()
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[INFO/ForkPoolWorker-2] child process calling self.run()
[DEBUG/MainProcess] Queue._start_thread()
[DEBUG/MainProcess] doing self._thread.start()
[DEBUG/MainProcess] starting thread to feed data to pipe
[DEBUG/MainProcess] ... done self._thread.start()
/usr/local/lib/python3.5/dist-packages/skimage/transform/_warps.py:84: UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.
warn("The default mode, 'constant', will be changed to 'reflect' in "
[INFO/ForkPoolWorker-1] process shutting down
[DEBUG/ForkPoolWorker-1] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-1] running the remaining "atexit" finalizers
Process ForkPoolWorker-1:
Traceback (most recent call last):
File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
self.run()
File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
initializer(*initargs)
File "py_examples/object_detection_app.py", line 115, in worker
results = interpret_output(out.astype(np.float32), frame.shape[1], frame.shape[0])
File "py_examples/object_detection_app.py", line 55, in interpret_output
boxes = (np.reshape(output[1078:],(7,7,2,4)))
File "/usr/local/lib/python3.5/dist-packages/numpy/core/fromnumeric.py", line 232, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "/usr/local/lib/python3.5/dist-packages/numpy/core/fromnumeric.py", line 57, in _wrapfunc
return getattr(obj, method)(*args, **kwds)
ValueError: cannot reshape array of size 16922 into shape (7,7,2,4)
[INFO/ForkPoolWorker-1] process exiting with exitcode 1
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling with args (19,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[INFO/ForkPoolWorker-3] child process calling self.run()

Duplication layer Error

Hi there i wanted to convert tiny yolo cfg to yolo prototxt but i am getting this error.
configparser.DuplicateOptionError: While reading from 'tiny-yolo-azface-fddb.cfg' [line 44]: option 'batch_normalize' in section 'convolutional' already exists

Example typo/error

mvNCCompile prototxt/yolo_tiny_deploy.prototxt -w weights/yolo_tiny**_deploy**.caffemodel -s 12

EIther one needs to change the name of the weight file or use this name for downloaded weight file.

mvNCCompile prototxt/yolo_tiny_deploy.prototxt -w weights/yolo_tiny.caffemodel -s 12

load model

How can I load several models simultaneously?

Labels file

Hi.
Would it be possible to get the list of labels?
best regards

Can run sample for NCSv1.12

pi@raspberrypi:~/YoloV2NCS-1.0 $ python3 detectionExample/Main.py
Traceback (most recent call last):
File "detectionExample/Main.py", line 5, in
from ObjectWrapper import *
File "/home/pi/YoloV2NCS-1.0/detectionExample/ObjectWrapper.py", line 1, in
from libpydetector import YoloDetector
ImportError: /home/pi/YoloV2NCS-1.0/detectionExample/libpydetector.so: wrong ELF class: ELFCLASS64

I compiled it on another box a move the files, created the lync

can you share instructions for ncsdf 1.09 release?

Hi,

I just bought the Movidius stick and installed ncsdk 1.09 release. Seems the structure has changed a lot. Command line for mvNCCompile is different, and i cannot find the directory for ncapi/networks/YoloTiny/ . Could you please provide suggestions that how I can run tiny yolo in ncsdk1.09 please?

object detection multiprocessing graph load fail

The single image test works.
This appears to be a video capture issue.

The object detection is producing a graph.LoadTensor error

[INFO/ForkPoolWorker-1] process shutting down
[DEBUG/ForkPoolWorker-1] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-1] running the remaining "atexit" finalizers
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
    initializer(*initargs)
  File "py_examples/object_detection_app.py", line 113, in worker
    graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
[INFO/ForkPoolWorker-1] process exiting with exitcode 1
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling <built-in function close> with args (18,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[INFO/ForkPoolWorker-3] child process calling self.run()

Error running detectionExample

File " ./YoloV2NCS/detectionExample/ObjectWrapper.py", line 101, in Detect
ObjectWrapper.fifoInHandle[i],
NameError: name 'i' is not defined

Can't run example

Hello,
First of all, thank you for the project. I already installed the project and compiled everything. The problem is when I try to run 'python3 py_examples/yolo_example.py images/dog.jpg' I get the following error:

Device 0 Address: 3 - VID/PID 03e7:2150
Starting wait for connect with 2000ms timeout
Found Address: 3 - VID/PID 03e7:2150
Found EP 0x81 : max packet size is 512 bytes
Found EP 0x01 : max packet size is 512 bytes
Found and opened device
Performing bulk write of 865212 bytes...
Successfully sent 865212 bytes of data in 457.894553 ms (1.802010 MB/s)
Boot successful, device address 3
Found Address: 3 - VID/PID 03e7:f63b
done
Booted 3 -> VSC
Traceback (most recent call last):
File "py_examples/yolo_example.py", line 126, in
graph = device.AllocateGraph(blob)
File "/usr/local/lib/python3.5/dist-packages/mvnc/mvncapi.py", line 201, in AllocateGraph
raise Exception(Status(status))
Exception: mvncStatus.ERROR

Any suggestions? I do have the 'graph' file in the main folder. Thanks again!

can't load object_detection.py

Hey, I am getting an error loading this.

[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[DEBUG/ForkPoolWorker-2] Queue._after_fork()
[INFO/ForkPoolWorker-2] child process calling self.run()
[DEBUG/MainProcess] Queue._start_thread()
[DEBUG/MainProcess] doing self._thread.start()
[DEBUG/MainProcess] starting thread to feed data to pipe
[DEBUG/MainProcess] ... done self._thread.start()
[INFO/ForkPoolWorker-1] process shutting down
[DEBUG/ForkPoolWorker-1] running all "atexit" finalizers with priority >= 0
[DEBUG/ForkPoolWorker-1] running the remaining "atexit" finalizers
Process ForkPoolWorker-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib/python3.5/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.5/multiprocessing/pool.py", line 103, in worker
    initializer(*initargs)
  File "object_detection_app.py", line 113, in worker
    graph.LoadTensor(resize(frame/255.0,dim,1)[:,:,(2,1,0)].astype(np.float16), 'user object')
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
[INFO/ForkPoolWorker-1] process exiting with exitcode 1
[DEBUG/MainProcess] cleaning up worker 0
[Level 5/MainProcess] finalizer calling <built-in function close> with args (18,) and kwargs {}
[DEBUG/MainProcess] added worker
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[DEBUG/ForkPoolWorker-3] Queue._after_fork()
[INFO/ForkPoolWorker-3] child process calling self.run()

Let me know if you can help

Compilation issue

Facing error during compilation. Any idea on this?

Thanks for the help in advance.

mvNCCompile v02.00, Copyright @ Movidius Ltd 2016

Traceback (most recent call last):
File "/usr/local/bin/mvNCCompile", line 118, in
create_graph(args.network, args.inputnode, args.outputnode, args.outfile, args.nshaves, args.inputsize, args.weights)
File "/usr/local/bin/mvNCCompile", line 101, in create_graph
net = parse_caffe(args, myriad_config)
File "/usr/local/bin/ncsdk/Controllers/CaffeParser.py", line 365, in parse_caffe
if layers[0].type == 'Input':
IndexError: list index out of range

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.