2
$\begingroup$

I can find out whether an image is text:

ImageInstanceQ[img,Entity["Concept", "TextualMatter::m7642"]]

And if an image is most likely text, I can find out the probability that it is text:

ImageIdentify[img, All, 1, "Probability"]

But how do I find the probability that an image is text, even if it's, say, a picture of a lime? I'm looking for the fastest solution possible. My brightest idea at this point is to do a binary search over ImageInstanceQ with different recognition thresholds.

EDIT: I've found a method. Load the net:

imId = NetModel["Wolfram ImageIdentify Net V1"]

And then

imId[image, {"Probability", 
  Entity["Concept", "TextualMatter::m7642"]}]

But this takes on average 0.1 seconds for a 100x100 image. Is there any way to speed this up? I need to compute it about 20000 times.

$\endgroup$
1
  • $\begingroup$ You can post answers to your own question, that way it will be more visible to future visitors. $\endgroup$
    – C. E.
    Commented Jun 18, 2019 at 4:38

2 Answers 2

2
$\begingroup$

One method to achieve this is by loading the underlying neural network:

imId = NetModel["Wolfram ImageIdentify Net V1"]

And then

imId[image, {"Probability", 
  Entity["Concept", "TextualMatter::m7642"]}]

Although this is very slow. If anyone has a faster method I'd love to hear it.

$\endgroup$
1
$\begingroup$

Since I've trained a NN classifier in Wolfram Mathematica to identify a text image and get pretty good results.

I tell you that, you can use a lightweight net-structure like SqueezeNet

You can test the inference performance by NetModel["SqueezeNet V1 .1 Trained on ImageNet Competition Data"]

Maybe a LeNet is enough?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.