下記の様なコード,/examplesフォルダ内にconfig.phpとindex.php、画像.jpgを同じフォルダ内に入れ、APIで判定テストを行おうとしています。
しかしindex.phpを開いたところ、以下の様なエラーが出ます。
Fatal error: Class 'RecognizeImAPI' not found in
Classの書き方にミスがある様なのですがなかなか解決ができず・・・
御指南いただけますと幸いです。
よろしくお願いします。
以下がファイルの内容です。
config.php
php
1<?php 2\RecognizeImAPI::init(array( 3 'URL' => $url, 4 'CLIENT_ID' => $client_id, 5 'API_KEY' => $api_key, 6 'CLAPI_KEY' => $clapi_key 7)); 8 9return array( 10 'URL' => 'http://clapi.itraff.pl/', 11 'CLIENT_ID' => '45341', 12 'API_KEY' => '7246059af7', 13 'CLAPI_KEY' => '75257528c5ea5f08088b536c99b217a9', 14); 15?>
index.php
php
1<?php 2 3//RecognizeImAPI::imageDelete(); die; 4 5$imagePath = 'test.jpg'; 6$mode = 'single'; 7RecognizeImAPI::init(array( 8 'URL' => $url, 9 'CLIENT_ID' => $client_id, 10 'API_KEY' => $api_key, 11 'CLAPI_KEY' => $clapi_key 12)); 13 14return array( 15 'URL' => 'http://clapi.itraff.pl/', 16 'CLIENT_ID' => '45341', 17 'API_KEY' => '7246059af7', 18 'CLAPI_KEY' => '75257528c5ea5f08088b536c99b217a9', 19); 20?> 21if (RecognizeImAPI::checkImageLimits($imagePath, $mode)) { 22 $singleOneResult = RecognizeImAPI::recognize(file_get_contents($imagePath), $mode); 23 $singleAllResults = RecognizeImAPI::recognize(file_get_contents($imagePath), $mode, TRUE); 24 echo $singleOneResult, "\n", $singleAllResults, "\n"; 25 if ($singleOneResult->isOK()) { 26 $im = $singleOneResult->drawFrames(file_get_contents($imagePath)); 27 file_put_contents('frames.jpg', $im); 28 } 29} else { 30 echo "Image does not fulfill the requirements.\n"; 31} 32//$imageList = RecognizeImAPI::imageList(); 33
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。