cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Getting a Text Value from object detection

Hello, 

 

I have been working with the object detector. As a test model I used a calculator. Everything works fine however I am struggling with how to pull the result of the scan onto a label. I just want the object name that is scanned to be put in a label. Right now the labels code that I am trying to use is as follows:

 

 

ObjectDetector1.VisionObjects.displayName

 

Any help would be much appreciated!!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Getting a Text Value from object detection

The easiest way is to use a data table (Insert > Data table)

 

Then select your data table and in the formula bar type: 

ObjectDetector1.VisionObjects

 

Once that's done, you just need to select the fields you want to display. (Edit fields from the right panel and then select the fields you want to display like displayName and count). 

 

If you want more control over the visualization, you can use a productGallery instead of a data table. 

View solution in original post

7 REPLIES 7
Highlighted
Power Apps
Power Apps

Re: Getting a Text Value from object detection

Hi Max, would you be able to provide a visual example of what you are trying to achieve? Are you trying to detect an object and then extract text within the bounds of that object? Or are you just trying to extract text from an image?

Highlighted
Helper II
Helper II

Re: Getting a Text Value from object detection

Yes! Below is the test app that I am running as you can see it registers the calculator. In the label below I am trying to have it say "calculator." or whatever the object is be it a stapler or glasses etc. Let me know if you need any more info!

 

Unknown.jpeg

Highlighted
Power Apps
Power Apps

Re: Getting a Text Value from object detection

Ah ok, that makes sense. I think what you're looking for is "First(ObjectDetector1.Results).tagName". Let me know if that works or if I misunderstood.

Highlighted
Community Support
Community Support

Re: Getting a Text Value from object detection

Hi  @antoinec 

It seems we are not able to exact Text from the ObjectDetector component since we cannot find any Results outcome.

Am I miss something?

Annotation 2020-02-27 143157.png

Sik

Highlighted
Power Apps
Power Apps

Re: Getting a Text Value from object detection

@MaxWendorff , 

 

If you only have one object, you can use this:

If(First(ObjectDetector1.VisionObjects).count > 0, First(ObjectDetector1.VisionObjects).displayName)

 

The If statement is here just to make sure there is at least one object in the picture. 

 

Thanks,

Nicolas

Highlighted
Helper II
Helper II

Re: Getting a Text Value from object detection

That 100% works for 1 object!! However I have 3 different objects (Stapler,Calculator and Safety Glasses) would there be a way as of now to be able to get the result in text from the other two? Or does this method only work with a one object model? Let me know what you think and I appreciate the help!!

Highlighted
Power Apps
Power Apps

Re: Getting a Text Value from object detection

The easiest way is to use a data table (Insert > Data table)

 

Then select your data table and in the formula bar type: 

ObjectDetector1.VisionObjects

 

Once that's done, you just need to select the fields you want to display. (Edit fields from the right panel and then select the fields you want to display like displayName and count). 

 

If you want more control over the visualization, you can use a productGallery instead of a data table. 

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Kudoed Authors
Users online (9,598)