var img_area = $("#img_area");
var img = $("");
var field = $("#field");
var img_file;
var datas;
const app = new Clarifai.App({
apiKey: 'f4e2e5ffe87c472883962a126db5401d'
});
function execute(file){
app.models.predict({id: Clarifai.GENERAL_MODEL,language: 'ja'}, {base64: file}).then(
function(response) {
var output_obj = response;
datas = output_obj.outputs[0].data.concepts;
output_datas(datas);
},
function(err) {
console.error(err);
}
);
}
function set_img(file){
if(file === "no"){
img.attr("src", "");
}else{
img.attr("src", file);
}
}
function output_datas(d){
var str = "";
if(d !== "no"){
if(d === "doing"){
str = "処理中";
}else{
str = d[0].name;
for(var i=1; i