-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question about applying trained model over image and its performance for real time processing #351
Comments
Ok, I found this article, so will try to adopt it: |
Ok, I realized by myself, by storing first the model into ZIP file:
Instead of drop the files into folder by following code from one of examples:
Then I did following:
and got following result:
[0.22, 0.04, 0.72, 0.02] numbers represents probablity for each of 4 tested labels (bear, deer, duck and turtle). As suggested in the manual, this network example is not much accurate, but I finished my first example. Long live DL4J :-) The only thing what worry me is the performance of image processing: This is about 0.5 second for single image with 3 channels (RBG) of size 100x100, this is really bad for real-time video processing :-(, I also not my GPU is not enabled due to some bug reported yesterday nad possibly fixed today. I am closing this issue and will reopen new regarding the throughput. |
You do know that you can perform OpenCV operations in dl4j, See |
@tomthetrainer I know, but how OpenCV will help me with image comparision against trained network, I thought OpenCV is used mainly for image transformations in preparing datasets for network training, am I wrong on this? If yes, how could OpenCV speedup image labeling from existing network? .... Anyway I am going to read that article, thanks a lot! And enable GPU and do same dummy test on single image. |
OpenCV won't help with speedup, really I just saw you mention openCV and thought you should know that you could use it inside DL4J. I thought perhaps you wanted to extract a feature using OpenCV and ship that to the network for inference. |
Well I also doesn't like log4j version 1, better to implement log4j2 with asynchronous appenders everywhere. Anyway I switched from native to CUDA nd4j backend and run few executions to see something like AVG value of exec time: Well, my minimal requirement is 20-30 FPS. I will also test on multiple GPUs if better numbers. |
@tomthetrainer Thanks for hints Tom, I am now doing lots of tests regarding real-time processing of streams where task is to track players and ball over playfield, so I am not sure now if this is ok to do with dl4j in online mode.... I of course could process the stored video later for analysis, but one of features should be also online mode... I will try to examine some tuning and lets see what number I will be able to obtain, the minimum number to be accepted is 50ms for single image... Anyway it is really fun working with this stack 👍 |
As opposite to this I might fall back to OpenCV Classifier class. |
Ok, I extended the logging for each and every from those few commands and the output is following:
Ok, so I identified the most consuming tasks: 1. Image loaded in 117.421528ms.
2. Image processed by network in 101.961865ms Still I will run on multiGPU system with for example 2 titan X 12GB Pascal/Maxwell instead of on 960M on my laptop in the moment. Any suggestions on this performance appreciated. |
Here is interesting comparison of different object recognition methods. So I will give it a try to investigate/implement the most performant approaches by using DL4J. Happy to hear any hints here |
Regarding the image loading time, i am going to look deeper tomorrow at:
Or more preciously at public INDArray asMatrix(Mat image) throws IOException At first look I am having some ideas about how to possibly speed this process up, but will test tomorrow first. |
This issue has been inactive for a while. can we close it? |
Hi guys,
I trained a network for AnimalClassification from examples, the result is:
How can I apply this network to image taken from OpenCV for example in object of type Frame or Mat?
Thanks a lot for this amazing work. I went trough Torch and Tensor flow, but as being Java developer, this is so far most most easy to adopt.
The text was updated successfully, but these errors were encountered: