#CustomVision – Analyzing images in a Console App using a #CustomVision project in a #Docker Container

Hi !

This is a special post. It’s the 1st one I write completely in my MacBook, so I’m sure that Javier (@jsuarezruiz), Yeray (@JosueYeray), Braulio (@braulio_sl), Luis, Sara, Roberto and other mac users will be proud of me 😀

So, I build and run my Custom Vision Marvel project in Docker for Mac. Smooth build and also a fast one!

docker build -t elbruno/cvmarvel:3.0 .

01 doker build on mac

Then get the image id and run the image

03 docker list images and run image

Final step is to play around with curl in bash to post the image (the file name with @ prefix took me some bing searches). Iron Fist detected !

curl -X POST http://127.0.0.1:8080/image -F imageData=@img1.jpg 

05 docker bash ls image analyzed and source image.png

Ok, the environment is working, so it’s time to create a .NetCore Console App to test this using amazing C# code. I have all my code in Azure Dev Ops, so I sync my repo and  added a new project in my current solution

06 new netcore project in visual studio for mac

Some C# lines in my console app and I was able to analyze a local picture using the Custom Vision Model in a container

07 console app in vs for mac detected image

The source code is very simple

Happy coding!

Greetings @ Toronto

El Bruno

References

My Posts

Windows 10 and YOLOV2 for Object Detection Series

19 thoughts on “#CustomVision – Analyzing images in a Console App using a #CustomVision project in a #Docker Container”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.