-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed urlencode bug for models and added additional clarifai models.
- Loading branch information
1 parent
1810902
commit 90b3874
Showing
5 changed files
with
15 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* | ||
* @author Nick White <[email protected]> | ||
* @link https://github.com/PHPfanatic/clarifai | ||
* @version 1.2.0 | ||
* @version 1.2.1 | ||
*/ | ||
|
||
abstract class AbstractBaseApi implements AuthInterface | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @author Nick White <[email protected]> | ||
* @link https://github.com/PHPfanatic/clarifai | ||
* @version 1.2.0 | ||
* @version 1.2.1 | ||
*/ | ||
|
||
interface AuthInterface { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @author Nick White <[email protected]> | ||
* @link https://github.com/PHPfanatic/clarifai | ||
* @version 1.2.0 | ||
* @version 1.2.1 | ||
*/ | ||
|
||
use PhpFanatic\clarifAI\Api\AbstractBaseApi; | ||
|
@@ -28,7 +28,11 @@ class ImageClient extends AbstractBaseApi | |
'Color'=>'eeed0b6733a644cea07cf4c60f87ebb7', | ||
'Apparel'=>'e0be3b9d6a454f0493ac3a30784001ff', | ||
'Celebrity'=>'e466caa0619f444ab97497640cefc4dc', | ||
'Face'=>'a403429f2ddf4b49b307e318f00e528b' | ||
'Face'=>'a403429f2ddf4b49b307e318f00e528b', | ||
'Demographics'=>'c0c0ac362b03416da06ab3fa36fb58e3', | ||
'Focus'=>'c2cf7cecd8a6427da375b9f35fcd2381', | ||
'Logo'=>'c443119bf2ed4da98487520d01a0b1e3', | ||
'Embedding'=>'bbb5f41425b8468d9b7a554ff10f8581' | ||
]; | ||
|
||
private $languages = [ | ||
|
@@ -131,7 +135,7 @@ public function ModelDelete($id=null, $version=null) { | |
$service="models"; | ||
|
||
if($id != null) { | ||
$service .= '/' . $id; | ||
$service .= '/' . urlencode($id); | ||
} | ||
|
||
if($id != null && $version != null) { | ||
|
@@ -194,7 +198,7 @@ public function ModelTrain($id) { | |
} | ||
} | ||
|
||
$service = 'models/'.$id.'/versions'; | ||
$service = 'models/'.urlencode($id).'/versions'; | ||
$result = $this->SendPost(null, $service); | ||
|
||
return (Response::GetJson($result)); | ||
|
@@ -222,7 +226,7 @@ public function Predict($model='General') { | |
|
||
// Custom model handler. | ||
if(!array_key_exists($model, $this->models)) { | ||
$service = 'models/' . $model . '/outputs'; | ||
$service = 'models/' . urlencode($model) . '/outputs'; | ||
} | ||
else { | ||
$service = 'models/' . $this->models[$model] . '/outputs'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* | ||
* @author Nick White <[email protected]> | ||
* @link https://github.com/PHPfanatic/clarifai | ||
* @version 1.2.0 | ||
* @version 1.2.1 | ||
*/ | ||
|
||
class Response | ||
|