Ask the IoT Expert: Computer Vision based AI Workloads at the Edge

%3CLINGO-SUB%20id%3D%22lingo-sub-1734613%22%20slang%3D%22en-US%22%3EAsk%20the%20IoT%20Expert%3A%20Computer%20Vision%20based%20AI%20Workloads%20at%20the%20Edge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1734613%22%20slang%3D%22en-US%22%3E%3CP%3ERecent%20advances%20in%20artificial%20intelligence%20allow%20computers%20the%20ability%20to%20identify%20objects%20within%20image%20data%20and%20video%20streams%20in%20near%20real-time.%26nbsp%3B%20This%20concept%2C%20referred%20to%20as%20%E2%80%9CComputer%20Vision%E2%80%9D%20is%20now%20more%20accessible%20than%20ever%20before%2C%20with%20the%20advent%20of%20services%20like%20CustomVision.AI%20that%20can%20allow%20you%20to%20train%20custom%20object%20detection%20models%20by%20providing%20sample%20images%20of%20the%20objects%20of%20interest.%26nbsp%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20computer%20power%20is%20increasing%2C%20it%20is%20unlocking%20the%20ability%20run%20accelerated%20computer%20vision%20workloads%20on%20small%20form-factor%20IoT%20devices.%26nbsp%3B%26nbsp%3B%20This%20opens%20the%20door%20to%20a%20wave%20of%20AI%20powered%20solutions%20which%20can%20perform%20vision%20related%20tasks%20without%20the%20need%20for%20heavy%20computational%20resources%20located%20off-site.%26nbsp%3B%20This%20paradigm%20is%20often%20referred%20to%20as%20the%20Artificial%20Intelligence%20of%20Things%20or%20AIOT.%26nbsp%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3EApplications%20of%20AIOT%20can%20provide%20benefit%20to%20practically%20any%20physical%20space%20(factories%2C%20smart%20cities%2C%20office%20space%20etc.)%20by%20allowing%20for%20solutions%20that%20can%20detect%20anomalies%2C%20alert%20on%20visual%20cues%2C%20and%20provide%20insight%20into%20the%20environment%20by%20using%20camera%20feeds%20as%20a%20new%20means%20of%20sensor%20input%20operated%20on%20by%20Computer%20Vision%20algorithms.%3CBR%20%2F%3E%3CBR%20%2F%3EMy%20name%20is%20Paul%20DeCarlo%2C%20Principal%20Cloud%20Developer%20Advocate%20at%20Microsoft%2C%20with%20a%20focus%20on%20Internet%20of%20Things%20solutions%20and%20the%20application%20of%20Computer%20Vision%20concepts%20within%20Edge%20environments.%26nbsp%3B%20I%20have%20a%20passion%20for%20sharing%20how%20to%20design%20and%20develop%20AIOT%20solutions%20with%20broad%20audiences%20and%20often%20do%20so%20in%20the%20form%20of%20%3CA%20href%3D%22http%3A%2F%2Faka.ms%2Fintelligentvideoanalytics%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Edeveloper%20livestreams%3C%2FA%3E%20and%20the%20creation%20of%20%3CA%20href%3D%22http%3A%2F%2Faka.ms%2Fiotlp%2Fblog%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Eonline%20training%20materials%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%3EAre%20you%20interested%20in%20learning%20more%20about%20how%20Computer%20Vision%20workloads%20might%20work%20for%20you%20or%20are%20you%20interested%20in%20exploring%20the%20field%20to%20understand%20what%20is%20currently%20possible%3F%26nbsp%3B%20I%20am%20here%20to%20answer%20any%20and%20all%20questions%20that%20you%20might%20have%20regarding%20the%20topic%20from%20all%20levels%2C%20whether%20you%20have%20a%20specific%20question%20on%20how%20to%20implement%20the%20appropriate%20computer%20vision%20algorithm%20to%20solve%20a%20problem%20for%20your%20line%20of%20business%20or%20if%20you%20are%20interested%20in%20where%20to%20get%20started%20from%20a%20beginner%20perspective.%26nbsp%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3EI%20will%20be%20monitoring%20this%20forum%20throughout%20the%20month%20of%20October%20and%20look%20forward%20to%20helping%20answer%20your%20questions%20as%20they%20arise.%26nbsp%3B%20%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20have%20any%20questions%20regarding%20Computer%20Vision%20based%20AI%20Workloads%20at%20the%20Edge%2C%20please%20leave%20them%20as%20comments%20in%20this%20very%20discussion%20and%20either%20myself%20or%20members%20of%20the%20community%20will%20be%20on%20hand%20to%20provide%20you%20with%20answers.%20To%20make%20this%20Ask%20the%20IoT%20Expert%20globally%20inclusive%20the%20Q%26amp%3BA%20will%20play%20out%20in%20this%20post%20and%20last%20for%20the%20whole%20month%20of%20October.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1967201%22%20slang%3D%22en-US%22%3ERe%3A%20Ask%20the%20IoT%20Expert%3A%20Computer%20Vision%20based%20AI%20Workloads%20at%20the%20Edge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967201%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F311952%22%20target%3D%22_blank%22%3E%40pdecarlo%3C%2FA%3E%26nbsp%3B%20I%20have%20been%20following%20you%20guidance%20and%20I%20really%20appreciate%20all%20the%20work%20you%20put%20into%20these%20documents.%20I%20have%20been%20having%20trouble%20figuring%20out%20however%20attaching%20USB%20cameras%20as%20a%20source.%20I%20believe%20I%20have%20the%20right%20brands%20but%20my%20goal%20was%20to%20use%20two%20USB%20cameras%20for%20a%20connected%20project.%20I%20might%20of%20missed%20where%20you%20discussed%20that%20in%20the%20past.%20If%20so%20I%20apologize.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1967212%22%20slang%3D%22en-US%22%3ERe%3A%20Ask%20the%20IoT%20Expert%3A%20Computer%20Vision%20based%20AI%20Workloads%20at%20the%20Edge%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1967212%22%20slang%3D%22en-US%22%3E%3CP%3EEssentially%2C%20you%20need%20to%20expose%20the%20%2Fdev%2Fvideo*%20entry%20to%20the%20container%20and%20from%20there%20it%20should%20be%20accessible%20from%20your%20IoT%20Edge%20workload.%3CBR%20%2F%3E%3CBR%20%2F%3EFirst%20list%20the%20available%20USB%20video%20devices%20like%20this%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3Els%20-ltrh%20%2Fdev%2Fvideo*%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EWhich%20should%20list%20your%20available%20devices%2C%20then%20for%20each%20device%20that%20you%20would%20like%20exposed%20to%20an%20IoT%20Edge%20Module%2C%20add%20an%20entry%20similar%20to%20the%20following%20for%20your%20devices%20in%20your%20deployment.template.json%3A%3C%2FP%3E%0A%3CPRE%3E%3CSPAN%20class%3D%22pl-s%22%3E%3CSPAN%20class%3D%22pl-pds%22%3E%22HostConfig%22%3A%20%7B%3CBR%20%2F%3E%22%3C%2FSPAN%3EDevices%3CSPAN%20class%3D%22pl-pds%22%3E%22%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%3E%3A%20%5B%3C%2FSPAN%3E%3CBR%20%2F%3E%3CCODE%3E%7B%0A%20%20%20%22PathOnHost%22%3A%20%22%2Fdev%2Fvideo0%22%2C%0A%20%20%20%22PathInContainer%22%3A%22%2Fdev%2Fvideo0%22%2C%0A%20%20%20%22CgroupPermissions%22%3A%22rwm%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%7D%2C%3CBR%20%2F%3E%7B%0A%20%20%20%22PathOnHost%22%3A%20%22%2Fdev%2Fvideo1%22%2C%0A%20%20%20%22PathInContainer%22%3A%22%2Fdev%2Fvideo1%22%2C%0A%20%20%20%22CgroupPermissions%22%3A%22rwm%22%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0A%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%3CBR%20%2F%3EWe%20have%20an%20article%20that%20focuses%20on%20connecting%20CSI%20cameras%20that%20should%20assist%20in%20more%20specifics%2C%20while%20not%20related%20to%20USB%20cameras%20the%20underlying%20concepts%20are%20very%20much%20relevant%3A%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fwww.hackster.io%2Fpjdecarlo%2Fcustom-object-detection-with-csi-ir-camera-on-nvidia-jetson-c6d315%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.hackster.io%2Fpjdecarlo%2Fcustom-object-detection-with-csi-ir-camera-on-nvidia-jetson-c6d315%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3EWe%20also%20have%20a%20a%20recorded%20livestream%20that%20I%20believe%20covers%20the%20usage%20of%20USB%20cameras%20and%20how%20to%20modify%20an%20associated%20DeepStream%20configuration%20to%20use%20them%20%40%20%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyZz-4uOx_Js%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyZz-4uOx_Js%3C%2FA%3E%3CBR%20%2F%3E%3CBR%20%2F%3ELet%20me%20know%20if%20this%20helps%2C%20while%20not%20specific%20to%20your%20request%20it%20should%20give%20details%20on%20the%20bigger%20picture%20to%20help%20understand%20how%20to%20accommodate%20a%20variety%20of%20video%20input%20methods.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

Recent advances in artificial intelligence allow computers the ability to identify objects within image data and video streams in near real-time.  This concept, referred to as “Computer Vision” is now more accessible than ever before, with the advent of services like CustomVision.AI that can allow you to train custom object detection models by providing sample images of the objects of interest. 

As computer power is increasing, it is unlocking the ability run accelerated computer vision workloads on small form-factor IoT devices.   This opens the door to a wave of AI powered solutions which can perform vision related tasks without the need for heavy computational resources located off-site.  This paradigm is often referred to as the Artificial Intelligence of Things or AIOT. 

Applications of AIOT can provide benefit to practically any physical space (factories, smart cities, office space etc.) by allowing for solutions that can detect anomalies, alert on visual cues, and provide insight into the environment by using camera feeds as a new means of sensor input operated on by Computer Vision algorithms.

My name is Paul DeCarlo, Principal Cloud Developer Advocate at Microsoft, with a focus on Internet of Things solutions and the application of Computer Vision concepts within Edge environments.  I have a passion for sharing how to design and develop AIOT solutions with broad audiences and often do so in the form of developer livestreams and the creation of online training materials.

Are you interested in learning more about how Computer Vision workloads might work for you or are you interested in exploring the field to understand what is currently possible?  I am here to answer any and all questions that you might have regarding the topic from all levels, whether you have a specific question on how to implement the appropriate computer vision algorithm to solve a problem for your line of business or if you are interested in where to get started from a beginner perspective. 

I will be monitoring this forum throughout the month of October and look forward to helping answer your questions as they arise. 

If you have any questions regarding Computer Vision based AI Workloads at the Edge, please leave them as comments in this very discussion and either myself or members of the community will be on hand to provide you with answers. To make this Ask the IoT Expert globally inclusive the Q&A will play out in this post and last for the whole month of October.

2 Replies

@pdecarlo  I have been following you guidance and I really appreciate all the work you put into these documents. I have been having trouble figuring out however attaching USB cameras as a source. I believe I have the right brands but my goal was to use two USB cameras for a connected project. I might of missed where you discussed that in the past. If so I apologize. 

 

Essentially, you need to expose the /dev/video* entry to the container and from there it should be accessible from your IoT Edge workload.

First list the available USB video devices like this:

ls -ltrh /dev/video*

Which should list your available devices, then for each device that you would like exposed to an IoT Edge Module, add an entry similar to the following for your devices in your deployment.template.json:

"HostConfig": {
"
Devices"
: [
{ "PathOnHost": "/dev/video0", "PathInContainer":"/dev/video0", "CgroupPermissions":"rwm" },
{ "PathOnHost": "/dev/video1", "PathInContainer":"/dev/video1", "CgroupPermissions":"rwm" }
]
}


We have an article that focuses on connecting CSI cameras that should assist in more specifics, while not related to USB cameras the underlying concepts are very much relevant:
https://www.hackster.io/pjdecarlo/custom-object-detection-with-csi-ir-camera-on-nvidia-jetson-c6d315

We also have a a recorded livestream that I believe covers the usage of USB cameras and how to modify an associated DeepStream configuration to use them @ https://www.youtube.com/watch?v=yZz-4uOx_Js

Let me know if this helps, while not specific to your request it should give details on the bigger picture to help understand how to accommodate a variety of video input methods.

www.000webhost.com