darrynten / clarifai-php Goto Github PK
View Code? Open in Web Editor NEWClarifai API client for PHP
License: MIT License
Clarifai API client for PHP
License: MIT License
Hey guys - we just introduced API Keys to replace access tokens. Would be cool to see it in here!
Hi, I had some problems with your repository, does not work for me.
I created a new project, based in your code. I share you my code por improve your project with react native, laravel and Clarifai.
Thanks for your support, your project is awesome.
I share my project.
PHP Laravel - API (with your repository)
(https://github.com/gusplayer/clarifai-laravel-php)
React-Native APP Android/ IOS
(https://github.com/gusplayer/image-recognition)
The project could not be analyzed because of maven build errors. Please review the error messages here. Another build will be scheduled within 24 hours. If the build is successful this issue will be closed, otherwise the error message will be updated.
This is an automated GitHub Issue created by Sonatype DepShield. GitHub Apps, including DepShield, can be managed from the Developer settings of the repository administrators.
I'm getting the following error from clarifai while trying to update input concept:
{"status":{"code":11100,"description":"Bad request format","details":"invalid JSON: %!(EXTRA string=json: cannot unmarshal number into Go value of type string)"}}
,
Here is my code:
$clarifai = sClarifai::getClarifai(); $concept = new Concept(); $concept->setId(self::CONCEPT_BEAUTIFUL)->setValue($this->beautiful == 1) $inputResult = $clarifai->getInputRepository()->getById($this->id); $modelResult = $clarifai->getInputRepository()->mergeInputConcepts([$this->id => [$concept]]);
Hello,
On making the call with the given code below, the code always returns an error that the "getModel" method doesn't exist. Moreover "\DarrynTen\Clarifai\Repository\Model::GENERAL" this also is not found. Is there any fix to this problem?
$clarifai = new Clarifai($this->clientId, $this->clientSecret);
$modelResult = $clarifai->getModel()->predictUrl(
'https://samples.clarifai.com/metro-north.jpg',
\DarrynTen\Clarifai\Repository\Model::GENERAL
);
1: We are not able to add/merge concepts later after creating a custom model it throws an error.
2: It is not exactly training our model, just writing a train command it says model trained successfully based on no inputs, we are not exactly getting how to train our model.
3:Most Important while getting a predictions for an image it returns a prediction of all the concepts stored with our model which actually are not correct.
For Example- For My Pets Model my concepts are dog and cat and while predicting any dog image it returns prediction value for dog as 0.24.. and cat 0.26.
our prediction for dog must be higher than cat which is not.
Kindly help us how exactly clarifai is working.
As per the latest update by Clarifai, the Client Id and Secret has been replaced by API Key. This makes the current version of this library impossible to use for new accounts.
I am trying to send multiple images with just one api call, but the result is a empty json foreach image I sent.
The code that I am using is:
foreach ($imagBase64 as $key => $imgbase64) {
$input[$key] = new DarrynTen\Clarifai\Entity\Input();
$input[$key]->setImage($imgbase64)->isEncoded()->setId($key);
}
$inputResult = $clarifai->getInputRepository()->add($input);
$inputResult = $clarifai->getInputRepository()->get();
$results = json_decode(json_encode($inputResult));
var_dump($results);
If I send each image in an individual API Call using the following code I get the result:
foreach ($imagBase64 as $key => $imgbase64) {
$modelResult[$key] = $clarifai->getModelRepository()->predictEncoded(
$imgbase64, \DarrynTen\Clarifai\Repository\ModelRepository::GENERAL
);
}
foreach ($modelResult as $key => $result) {
$image[$key] = json_decode(json_encode($result));
}
What I am doing wrong? I think maybe I need to set a ModelRepository, but I don't find a funtion to do this in documentation.
A few people have asked about batching calls with this client (both for predictions and image uploads). Would be great to have that in here as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.