Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

downgraded javacv to 1.5, this uses opencv 4.0.1 without openblas dep… #338

Merged
merged 10 commits into from
May 6, 2020

Conversation

deinhofer
Copy link
Contributor

@deinhofer deinhofer commented May 5, 2020

…endency.

  • This should reduce the .jar sizes and speed up first-time model deployment
  • To be checked:
    • @bmedicke : Mac still supported?
    • Did first-time deployment for others improve?

How to test:

git fetch
git checkout javacv-upgrade-and-optimizations-1.5
ant clean
ant run-debug

…endency.

* This should reduce the .jar sizes and speed up first-time model deployment
* To be checked: Mac still supported? Did startup-time for others improve?
@ChrisVeigl
Copy link
Contributor

hi,
works on Win10 Laptop, first-time-deployment is a lot faster indeed...
(branch name needs prefix deinhofer: git checkout deinhofer/javacv-upgrade-and-optimizations-1.5)

@deinhofer
Copy link
Contributor Author

hi,
works on Win10 Laptop, first-time-deployment is a lot faster indeed...
(branch name needs prefix deinhofer: git checkout deinhofer/javacv-upgrade-and-optimizations-1.5)

Thanks for testing! Should be even more fast now. Split up architecture bundles into x86_64 and x86 on Windows.
When loading a service jar, the folowing file names are checked:

javacv-xxx-<os>-<architecture>-<bitness>.jar
javacv-xxx-<os>-<architecture>.jar
javacv-xxx-<os>.jar

@deinhofer
Copy link
Contributor Author

  • added proper error message dialog, if camera can't be opened.
  • Made resizeHeight configurable, but this does not seem to have an impact --> probably remove property again
  • The reason why the face detection occurs at a certain distance only is, that I used a MIN_FACE_WIDTH=80 and MIN_FACE_HEIGHT=80 which was fine for the master branch as well. The idea was to prevent face detection in the background of the image. Actually only faces closer to the camera will very likely be faces for camera mouse usage.

@benjaminaigner
Copy link
Contributor

👍 , reduces loading time on my old PC from 5s to 1s:

     [java] Loading haarcascade classifier
     [java] XFaceTrackerMouse - AsTeRICS ARE #{APPLICATION_VERSION_NUMBER}# [:8081,:9090]
     [java] 2020-05-06 07:36:58.781 WARNING [DeploymentManager deployModel] While initializing runtime property values of plugin instance <XFacetrackerLK.1>: Ignoring propertyName <resizeHeight>, propertyValue <null>
     [java] 2020-05-06 07:36:58.806 INFO [AREServices deployFileInternal] Deployed Model XFaceTrackerMouse.acs !
     [java] 
     [java] 2020-05-06 07:36:58.824 INFO [SharedFrameGrabber init] Available grabber: [Default, OpenCV, FFmpeg, OpenKinect, RealSense, PS3Eye, DC1394, FlyCapture, FlyCapture2, IPCamera]
     [java] 2020-05-06 07:36:58.824 INFO [SharedFrameGrabber init] Default FrameGrabber: OpenCV
     [java] 2020-05-06 07:36:58.824 INFO [SharedFrameGrabber init] FrameGrabber: Default
     [java] 2020-05-06 07:36:58.824 INFO [SharedFrameGrabber init] DeviceKey: 0
     [java] 2020-05-06 07:36:58.824 INFO [SharedFrameGrabber init] Resolution: 320x240
     [java] 2020-05-06 07:36:58.825 INFO [SharedFrameGrabber init] grabberFormat: 
     [java] 2020-05-06 07:36:58.825 INFO [SharedFrameGrabber init] Using FrameGrabber: OpenCV
     [java] 2020-05-06 07:36:58.830 INFO [SharedFrameGrabber init] Setting deviceNr <0>
     [java] scaled face width: 136.0, orig.width: 68

@bmedicke
Copy link
Contributor

bmedicke commented May 6, 2020

This PR works just as well with macOS.

@klues
Copy link
Contributor

klues commented May 6, 2020

Tested on Win10, T470, Core-i7
First loading time of XCameraMouse: 2,2s (before with newer dependencies: 5s)
Instant face detection >100cm, before I needed to go closer to about 70cm

Made resizeHeight configurable, but this does not seem to have an impact --> probably remove property again

What is/was the intention of this property?

Actually only faces closer to the camera will very likely be faces for camera mouse usage.

Maybe it would be possible to limit the number of detected faces to 1 (if a face is already detected, do not detect another face). And if no face is detected the algorithm could start with a bigger minimum face size and decrease this property slowly, if no face is found. An easier solution maybe would be to just add a property "minFaceSize" which can be configured for a specific use case.

@sabicalija
Copy link
Contributor

sabicalija commented May 6, 2020

If tested again, as well:
HW: Lenovo Thinkpad P50 (Intel(R) Xeon(R) CPU E3-1505M v5 @ 2.80GHz, 32GiB DDR4)

Microsoft Windows: 10.0.18363.778
Java: 1.8.0_181-b13

ARE Startup: 20 sec.  (before: 3~5 sec.)
XCameraMouse (First) Startup: <3 sec.  (before: 3~5 sec.)
Ubuntu Desktop: 19.04 (disco)
Java: 1.8.0_232

ARE Startup: 8~9 sec.  (before: ~8 sec.)
XCameraMouse (First) Startup: 1~2 sec.  (before: <3 sec.)
XCameraMouse Distance: ~110cm  (before: 70cm)

I've started the ARE (on Windows) from terminal this time because there was no installer for this branch.

@deinhofer
Copy link
Contributor Author

Ok, I will remove the resizeHeight property again and merge.
I will build the final installer tonight so that we can publish them tomorrow.

@deinhofer deinhofer merged commit c88a5e1 into master May 6, 2020
@deinhofer deinhofer deleted the deinhofer/javacv-upgrade-and-optimizations-1.5 branch April 27, 2021 06:26
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants