# Issue deploying a FormPage using Classify

I developed this code that allows me to recognize what breed is the dog in the inserted image (for the time being developed only for five breeds of dogs), however, when I go to insert the image in output gives me a series of vectors . could you tell me where I'm wrong? I am attaching the code.

dobermann = {-> "Dobermann", -> "Dobermann", -> "Dobermann", ->
"Dobermann", -> "Dobermann"};
rottweiler = {-> "Rottweiler", -> "Rottweiler", -> "Rottweiler", ->
"Rottweiler", -> "Rottweiler"};
alano = {-> "Alano", -> "Alano", -> "Alano", -> "Alano", -> "Alano"};
husky = {-> "Husky", -> "Husky", -> "Husky", -> "Husky", -> "Husky" };
dogTypeSet = {dobermann, rottweiler, alano, labrador, husky};
dogTypes = Flatten[dogTypeSet];
class = Classify[
CloudDeploy[
FormPage["image" -> "Image",
Column[{image, "This is a " <> ToString[net[image]] <> "dog"}],
AppearanceRules -> <|"Title" -> "What dog is that?",
"Description" ->
"Enter an image of a dog and I'll tell you what it is"|>],
Permissions -> "Public"]


Before the arrows are inserted the images of each dog breed. I had to remove them otherwise the code became incomprehensible.

• There appears to be an issue in your code - you are calling net rather than class in your FormPage. In Column[{image, "This is a " <> ToString[net[image]] <> "dog"}], replace net with class. Jan 9 '19 at 17:15
• Done, but it gives me the following error: ClassifierFunction::mlincfttp: Incompatible variable type (Image) and variable value (image). Jan 9 '19 at 17:21
• Please see my answer - there was another error in your code I didn't immediately spot. Jan 9 '19 at 17:22

There are some errors in your code.

A working CloudDeploy statement is below.

CloudDeploy[
FormPage["image" -> "Image",
Column[{#image,
"This is a " <> ToString[class[#image]] <> "dog"}] &,
AppearanceRules -> <|"Title" -> "What dog is that?",
"Description" ->
"Enter an image of a dog and I'll tell you what it is"|>],
Permissions -> "Public"]


Firstly, FormPage takes a function as the second argument, rather than an expression. Thus, you must use #image rather than image and close the expression with a \$. Secondly, you misnamed class as net.

I have tried this myself with a day/night classifier (rather than dog breed classifier) and it works well.

• Thank you very much. One last thing, how could I train a neural network so that I can recognize any breed of dog. Doing as I did I use too much time. Jan 9 '19 at 17:29
• That is a separate question and you should open a new one accordingly. If you found this answer useful for your specific question, you should mark it as accepted. A starting point for a dog breed classifier would be the Stanford Dogs dataset which has many images of 120 different breeds. You would need to import the data to Mathematica and you could run Classify in it in a similar way. Jan 9 '19 at 17:33
• Now I try, in case I open a new discussion. Thank you. Jan 9 '19 at 17:35
• If instead I wanted to propose an interface on mathematica and not on the cloud, what should I change? Jan 9 '19 at 17:46
• @Pasquale Please consider opening a new question for follow-up questions, and consider marking this answer as accepted. Comments aren't good for long discussions! Jan 9 '19 at 17:56