[Plugin] HumanDetection - new plugin to analyze images and detect people in them

honeyjar

New member
I've created a plugin which allows to analyze images on the device and tells you if there's a person in the image.
This plugin exports an action with:

  • input: an image path, which may be in the form of file:///<something> or content://media/<something>
  • output: detection score: 0-100 for the likeliness of a person being in the image, -1 for some errors (but usually it will just raise an error which Macrodroid will see as such)
This plugin is intended to be used as a companion to "security" routines, so that if you receive an alarm from a motion-detection camera you can pass it thru this plugin and raise a real alarm on your phone only if you see a person in the frame!
The purpose of this plugin for me has been to avoid receiving false positive alarms while sleeping or in a meeting :)

Any feedback is welcome!

p.s.: no play store because I don't yet understand how to overcome some issues and thus I must target an older version of Android: any suggestion on how to fix this is welcome!
 

md_sgf

Active member
I forget about how to specify local paths.

Have tried:
• /storage/emulated/0/pic.jpeg
• content://storage/emulated/0/pic.jpeg
• content://pic.jpeg

Any ideas anyone?
 

honeyjar

New member
Local paths are specified as file:///<something> but beware that modern systems have substantial access permission limitations
Here are some simple values I use with success:
  • file:///sdcard/Pictures/Image1719684270.jpg
  • content://media/external/images/media/1000000035
the number after media is something which Android itself sets when you write it with your app.
Within the Plugin I do create a temporary file within a temp folder because OpenCV only supports file:/// format, thus I need to create a temp file starting from any URI in the form content://
 

Endercraft

Moderator (& bug finder :D)
I don't the permission MANAGE_EXTERNAL_STORAGE (all files access), if you add it that should allow access to all files once granted.
 

honeyjar

New member
I don't the permission MANAGE_EXTERNAL_STORAGE (all files access), if you add it that should allow access to all files once granted.
thanks, I'll try this ASAP
Google doesn't like that permission anymore so it might conflict with min/max SDK versions due to other constraints I've met with these parameters.
Will update you soon if I can make it easier to access any file
 

honeyjar

New member
I forget about how to specify local paths.

Have tried:
• /storage/emulated/0/pic.jpeg
• content://storage/emulated/0/pic.jpeg
• content://pic.jpeg

Any ideas anyone?
As suggested from @Endercraft I've added more permissions + an handy file picker, so that's dramatically easier to pick local files :)
 
Top