Coder Social home page Coder Social logo

clarifai-go's People

Contributors

cassidoo avatar philmod avatar robert-clarifai avatar samuelcouch avatar skewart avatar zeiler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clarifai-go's Issues

Implement a tag function from local file system

according to the documentation here you are able to make requests to the tag parameter with a local file, but this functionallity is not availble in this client. it seems to be implemented in the python client here. i'll be willing to put in a pull request.

Images and Videos tag response inconsistency

I have some problems with this library when getting tags for videos. The problem is this:

This is an example response from the tag endpoint for a .mp4 video:

{
    "results": [
        {
            "result": {
                    "classes": [
                        [
                            "no person",
                            "indoors",

And this is a response for an image:

{
    "results": [
        {
            "result": {
                "tag": {
                    "classes": [
                        "keyboard",

The classes field is an array of strings for images, but an array of an array of strings for videos.

This is the diff which fixes the video responses:

diff --git a/requests.go b/requests.go
index 22fdb06..96bb70b 100644
--- a/requests.go
+++ b/requests.go
@@ -56,9 +56,9 @@ type TagResult struct {
        LocalID       string   `json:"local_id"`
        Result        struct {
                Tag struct {
-                       Classes []string  `json:"classes"`
+                       Classes [][]string  `json:"classes"`
                        CatIDs  []string  `json:"catids"`
-                       Probs   []float32 `json:"probs"`
+                       Probs   [][]float32 `json:"probs"`
                }
        }
        DocIDString string `json:"docid_str"`

But this will break the image tag response.

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.