Giter Club home page Giter Club logo

api-examples's People

Contributors

coleca avatar josue avatar steverucker avatar whatsocks 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  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

api-examples's Issues

Problem with C#. Demo code ?

I am having problems with Postman code for c#. The suggested code for a detect operation is
var client = new RestClient("https://api.kairos.com/detect"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/json"); request.AddHeader("app_id", "3458eaed"); request.AddHeader("app_key", "2b9f9b765126465d4dcd263bbd5f8dc6"); request.AddFile("image", "/C:/Users/Simon/Pictures/Faces/Test (7).jpg"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);

This fails with an Illegal path message from C# in request.AddFile. Changing the line to
request.AddFile("image", @"C:\Users\Simon\Pictures\Faces\Test (7).jpg");
results in the request running OK but returning response content with the error message “image one or more required parameters are missing”.

The error message below is obtained in Postman by changing the Key value to anything other than "image" or the Value value to a non-existent local file
image one or more required parameters are missing

How can I run locally using Xampp?

Hello,
I am having an issue regarding running locally on my Mac. I have followed all the instruction from readme file. I have successfully run make and build command using docker. Now the thing is that I don't know how to run it locally.
Is there any document or step by step guide for How can I use Kairos api using Xampp?
Thanks in advance.

Docker Install Issue?

Hi,

Tried running this with 'make build && make run' and I get the following error:

Post http:///var/run/docker.sock/v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=demo&ulimits=null: dial unix /var/run/docker.sock: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
make: *** [build] Error 1

I've looked around as to why this is occuring but get led in circles, any idea what I need to do to resolve?

Comes error while app build

First of all, thank you for making such a beautiful API,
I have to try to build and run an application on my local machine but giving me following error after hitting command make build && make run. I have used my application key and id also.

docker build -t demo .
make: docker: No such file or directory
make: *** [build] Error 1

I've created a Kairos tutorial

Hey there,

Great job on the API, I'm impressed with how easy it is to use.

I'm the co-founder of an interactive coding course platform, and we're looking into creating sponsored courses on API's. Here's a quick tutorial I made on the Kairos API:

https://scrimba.com/c/cJ7dkS2

Let me know if you want to hear more about how we can create learning material on the API!

Code in ASP.NET MVC

Do you have the same example in ASP.NET MVC, because your sample doesn't seem to work perfectly in localhost..

Bad gateway error Nginx

I followed the steps but on running the demo, the nginx server reports a 502 Bad Gateway error.

I noticed it was because the PHP-FPM was failing to initialise
bash-4.3# /usr/bin/php-fpm -c /etc/php5 [30-Mar-2017 09:11:05] WARNING: Nothing matches the include pattern '/etc/php5/fpm.d/*.conf' from /etc/php5/php-fpm.conf at line 15. [30-Mar-2017 09:11:05] ERROR: [/etc/php5/php-fpm.conf:547] empty value [30-Mar-2017 09:11:05] ERROR: failed to load configuration file '/etc/php5/php-fpm.conf' [30-Mar-2017 09:11:05] ERROR: FPM initialization failed

I looked up the php-fpm.conf file at line number 547 and I noticed the DEMO_ID env variable was empty.

So I noticed that 2 environment variables DEMO_ID and DEMO_SECRET_KEY are not being set which is causing the FPM initialization to fail. If I comment these config variables, the server starts. However the api calls fail.

On further investigation I noticed the problem starts with docker-compose.yml file where the values are not set. Are these supposed to be the same values as the APP_ID and APP_SECRET_KEY ? If I do that the Emotion demo doesn't work. Others still work.

Real person recognition!

Hello, what parameters can I use for the system to understand that it is a real person and not a photo. I need to implement a security system, but I can not allow someone to show a photo (image) and the system recognizes!

Thank you!

I'm getting 502 Bad Gateway

I'm following the tutorial perfectly, but, when I'm going to access the page, I'm getting 502 Bad Gateway.

How can I fix it up?

Kairos Android Sdk Example missing

I have been working on Kairos Android SDK since Nov, 2018. Now, Suddenly I found that android sdk example is not available on git-hub. Any 1 can help with complete demonstrated example of android. If available provide link to project.

No Mapping Rule matched

Hi, I am trying to run the code with the demo image on Jupyter Notebook, but receive the following error:
No Mapping Rule matched

Did I not insert the image in the right way?

import requests

# I put my own id and key here
headers = {
    "app_id": " ",
    "app_key": " "
}

payload = '{"image":" https://media.kairos.com/kairos-elizabeth.jpg "}'

url = "https://api.kairos.com"

# make request
r = requests.post(url, data=payload, headers=headers)
print(r.content)

Upload local media to /v2/media via curl

It's not clear (to me) what the source parameter should look like when referencing local media, I have tried several things, via both cURL and postman, to no avail. Would you be so kind to provide a working example?

Thanks.

Running the Demo, I get 502 Bad Gateway

I am running Linux Mint 18.1(ubuntu xenial based)

I cloned the repo to kairos-api folder.

  • Added the API keys
  • Changed the docker name referance in Makefile
  • I also had an error with EXIF, which I solved by commenting out that line as it is provided by default.

When image is up and running and I try to access the docker image on:
http://localhost:8080/

I am getting the: 502 Bad Gateway nginx/1.10.1
So I get to the container nginx, but there is no data there.

Here is the terminal log:

kairos-api $ sudo make build && sudo make run
docker build  -t demo .
Sending build context to Docker daemon 32.17 MB
Step 1/6 : FROM kairos/nginx-php-alpine:latest
latest: Pulling from kairos/nginx-php-alpine
e110a4a17941: Pull complete 
3f504fc01783: Pull complete 
9067587fa9c1: Pull complete 
db82289b6532: Pull complete 
bf390e1a51c6: Pull complete 
d048952484cb: Pull complete 
Digest: sha256:6886cc01a178e25e01d864dbef0b99bd5bb68b30d22f5a2c6b66f074ef067fc7
Status: Downloaded newer image for kairos/nginx-php-alpine:latest
 ---> 851736af71bc
Step 2/6 : MAINTAINER Cole Calistra <[email protected]>
 ---> Running in 40c1d6192a10
 ---> 24e4befa3477
Removing intermediate container 40c1d6192a10
Step 3/6 : COPY . /tmp
 ---> 054a1adaa00a
Removing intermediate container 87c0ce702695
Step 4/6 : RUN apk update && apk add php5-gd php5-imagick ghostscript ghostscript-fonts php5-exif
 ---> Running in 0a3f25fdf6db
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
v3.4.6-116-g2862a47 [http://dl-cdn.alpinelinux.org/alpine/v3.4/main]
v3.4.6-83-g67e50bc [http://dl-cdn.alpinelinux.org/alpine/v3.4/community]
OK: 6005 distinct packages available
(1/26) Installing dbus-libs (1.10.8-r1)
(2/26) Installing libintl (0.19.7-r3)
(3/26) Installing avahi-libs (0.6.32-r0)
(4/26) Installing libgcc (5.3.0-r0)
(5/26) Installing gmp (6.1.0-r0)
(6/26) Installing nettle (3.2-r0)
(7/26) Installing libtasn1 (4.8-r0)
(8/26) Installing p11-kit (0.23.2-r0)
(9/26) Installing gnutls (3.4.15-r0)
(10/26) Installing libstdc++ (5.3.0-r0)
(11/26) Installing cups-libs (2.1.3-r1)
(12/26) Installing libpng (1.6.21-r0)
(13/26) Installing freetype (2.6.3-r0)
(14/26) Installing fontconfig (2.12.1-r0)
(15/26) Installing jbig2dec (0.12-r0)
(16/26) Installing libjpeg-turbo (1.4.2-r0)
(17/26) Installing lcms2 (2.8-r0)
(18/26) Installing tiff (4.0.7-r2)
(19/26) Installing ghostscript (9.19-r2)
(20/26) Installing ghostscript-fonts (8.11-r1)
(21/26) Installing php5-exif (5.6.30-r0)
(22/26) Installing php5-gd (5.6.30-r0)
(23/26) Installing libgomp (5.3.0-r0)
(24/26) Installing libwebp (0.5.0-r0)
(25/26) Installing imagemagick (6.9.5.9-r1)
(26/26) Installing php5-imagick (3.4.2-r1)
Executing busybox-1.24.2-r9.trigger
Executing fontconfig-2.12.1-r0.trigger
OK: 176 MiB in 81 packages
 ---> 53afbae18d3a
Removing intermediate container 0a3f25fdf6db
Step 5/6 : RUN cp -Rf /tmp/* /var/www/app/                       &&     cp /tmp/conf/default.conf /etc/nginx/conf.d/      &&     rm -Rf /var/www/app/conf /var/www/app/Dockerfile  &&     cp /tmp/scripts/nginx_env.sh  /usr/local/bin/     &&     chmod +x /usr/local/bin/nginx_env.sh              &&     rm -Rf /tmp/*                                     &&     touch /var/log/access.log /var/log/error.log      &&     touch /var/run/php-fpm.sock                       &&     touch /var/log/php-fpm.log /var/log/demo.log      &&     ln -sf /dev/stderr /var/log/php-fpm.log           &&     ln -sf /dev/stdout /var/log/demo.log              &&     ln -sf /dev/stdout /var/log/nginx/access.log      &&     ln -sf /dev/stderr /var/log/nginx/error.log       &&     sed -i -e "s/memory_limit = 128M/memory_limit = 512M/g" /etc/php5/php.ini &&     chown -R nginx:nginx /var/log/* /etc/nginx/*      &&     chown -R nginx:nginx /var/www/* /etc/php5/*       &&     cd /var/www/app/demo && composer update
 ---> Running in b7cfc03e8694
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
 ---> dfacfbfbfe8e
Removing intermediate container b7cfc03e8694
Step 6/6 : WORKDIR /var/log
 ---> 32eec92c7120
Removing intermediate container 8bc42c050b39
Successfully built 32eec92c7120
docker-compose up -d
Creating kairosapi_demo_1 ... 
Creating kairosapi_demo_1 ... done
docker exec kairosapi_demo_1 composer update -d /var/www/app/demo
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

Kairos API : subject_id one or more required parameters are missing

I'm trying to enroll person profile pic's using https://kairos.docs.apiary.io/#reference/face-recognition API. I have a following python code.

My python script:

#!/usr/bin/python3
    
import requests
import io
import http.client
import base64
import json
import glob, os
from os.path import basename

dir_path = "/home/Kairos/profiles/msc/" 

os.chdir(dir_path)

for file in glob.glob("*.*"):
    img_path = file
    print(img_path)
    files = {'image': (img_path, open(dir_path + img_path, 'rb'), 'image/jpg', {'Expires': '0'})}

    headers = {
        'app_id': "xxxx",
        'app_key': "xxxxxxxxxxxxxxxxxxxxxx",
    }

    values_enrol = {
       'subject_id':'msc',
       'gallery_name':'mscGallary'
    }

    res = requests.post('https://api.kairos.com/enroll', headers=headers, files=files, data=values_enrol)

    print(res.content)

But, I'm getting an error :

 "Errors": [
        {
            "ErrCode": 1002,
            "Message": "subject_id one or more required parameters are missing"
        },
        {
            "ErrCode": 1002,
            "Message": "gallery_name one or more required parameters are missing"
        }
    ]
}

What am I doing wrong here? Thanks in advance.

API not recognising person in video.

Whenever I tried to upload a video which is recorded from the front camera of the Android mobile device, API doesn't seem to recognise to person and giving me no person found in video error in the response.

Any workaround regarding this issue?

Invalid json response in emotion demo

I always get an error called: "invalid json response" in the emotion demo. When I upload the same video file on the official website from Kairos it works. Thats why the video file should work with the emotion demo here as well. Do you have an idea whats going wrong?

Response value ranges in emotion GET /media/

Where could one find out more details about response ranges in GET /media/{id}.

We are attempting to combine the individual charts for smile, surprise, negative and attention into one and are running into issues (have lack of confidence in accurate representation) with translating our min-max values.

Are the response values standardized, is there any documentation available around this?

Docker error

When trying to run the Docker commands I get:

docker build  -t demo .
Saved file tree to doc-filelist.js
Copied JS to doc-script.js
Compiled CSS to doc-style.css
docker-compose up -d
Pulling demo (demo:latest)...
ERROR: repository demo not found: does not exist or no pull access
make: *** [run] Error 1

Any ideas?

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.