Giter Site home page Giter Site logo

clarifai-php's Issues

Update for API Keys

Hey guys - we just introduced API Keys to replace access tokens. Would be cool to see it in here!

Error in input concept update

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]]);

The DarrynTen\Clarifai\Clarifai::getModel() Does not exist error.

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
);

Problem using clarifai

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.

Send Multiple Images in one call with IDs

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.

Batch Processing

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.