7
$\begingroup$

Suppose an image has multiple objects:

apricot-apple-banana

ImageIdentify only finds the banana:

im = Import["https://wolfr.am/6-m8QtHj"];
ImageIdentify[im]

returns

Entity["Concept","Banana::f6z73"]

If I crop around the apple, it finds it:

im2 = ImageTake[,{1,100},{100,200}];
ImageIdentify[im2]

returns

Entity["Concept","RedDelicious::xxzy3"]

But if I ask for 5 identifications, it still doesn't find the apple:

ImageIdentify[im,All,5]

returns

{Entity["Concept","EdibleFruit::5d4pn"],
 Entity["Concept","Banana::f6z73"],
 Entity["Concept","Fruit::855t9"],
 Entity["Concept","ReproductiveStructure::66t28"],
 Entity["Concept","GardenTruck::f8248"]
 }

Thoughts?

$\endgroup$
  • 1
    $\begingroup$ For me, using ImageIdentify[%, Entity["Concept", "Fruit::855t9"], 3, SpecificityGoal -> 1] finds all three fruit perfectly. $\endgroup$ – Patrick Stevens Sep 16 '15 at 21:22
  • $\begingroup$ Wonderful! That answers my question. Can you turn your comment into an answer so I can upvote it? Also, how did you know the magic code to add after "Fruit::" ? $\endgroup$ – ConvexMartian Sep 16 '15 at 22:21
5
$\begingroup$
ImageIdentify[%, Entity["Concept", "Fruit::855t9"], 3, SpecificityGoal -> 1]

I'm not really sure how robust this is, though. (I got "Fruit::855t9" by using the Ctrl+= input, and typing fruit.)

$\endgroup$
  • $\begingroup$ Thanks! How did you figure out the 855t9 to put after "Fruit"? $\endgroup$ – ConvexMartian Sep 16 '15 at 22:55
  • 2
    $\begingroup$ Ah, I see that ImageIdentify[%,"fruit",3,SpecificityGoal -> 1] works too. $\endgroup$ – ConvexMartian Sep 17 '15 at 5:25
  • $\begingroup$ I've edited it in. $\endgroup$ – Patrick Stevens Sep 17 '15 at 7:25
  • 1
    $\begingroup$ Update: Two years later, it appears ImageIdentify no longer gives the correct output. In Sep 2015 it returned {banana, rose apple, nectarine}, now it gives {banana, citrus, mango}. :-/. $\endgroup$ – ConvexMartian Sep 24 '17 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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