Giter VIP home page Giter VIP logo

autoattendance-cognitive's People

Contributors

aagrawal207 avatar malharsk27 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  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autoattendance-cognitive's Issues

how to obtain subscription key?

hey Abhishek,
I have a trial key for the Cognitive Face API, but whenever I replace your keys with my one, it say error 401.
i might have nit been able to link the key to my project.
can you please tell me how you got the key?
Did you use your Microsoft account to obtain the key?

Error 404: PersonGroupId Not found

image
C:\Users\Admin\Desktop\Autoattendance-Cognitive-master>python create_person.py user25
Traceback (most recent call last):
File "create_person.py", line 11, in
res = CF.person.create(personGroupId, str(sys.argv[1]))
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\cognitive_face\person.py", line 71, in create
return util.request('POST', url, json=json)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python38\lib\site-packages\cognitive_face\util.py", line 103, in request
raise CognitiveFaceException(response.status_code,
cognitive_face.util.CognitiveFaceException: Error when calling Cognitive Face API:
status_code: 404
code: PersonGroupNotFound
message: Person group is not found.
Parameter name: personGroupId

Can someone please help me out with this.

Some PersonGroupId Error

Hi,

I am trying to run this using Jupyter notebook.
The first script add_student.py works fine.
However the second script, create_person.py gives me the following error:

CognitiveFaceException Traceback (most recent call last)
in ()
4 CF.BaseUrl.set(BASE_URL)
5 if len(sys.argv) is not 1:
----> 6 res = CF.person.create(personGroupId, str(arg1))
7 print(res)
8 extractId = str(sys.argv[1])[-2:]

~\AppData\Local\Continuum\anaconda3\lib\site-packages\cognitive_face\person.py in create(person_group_id, name, user_data)
69 }
70
---> 71 return util.request('POST', url, json=json)
72
73

~\AppData\Local\Continuum\anaconda3\lib\site-packages\cognitive_face\util.py in request(method, url, data, json, headers, params)
103 raise CognitiveFaceException(response.status_code,
104 error_msg.get('code'),
--> 105 error_msg.get('message'))
106
107 # Prevent response.json() complains about empty response.

CognitiveFaceException: Error when calling Cognitive Face API:
status_code: 404
code: PersonGroupNotFound
message: Person group is not found.
Parameter name: personGroupId

Following is my code, I hope its correct:

`import sys
import cognitive_face as CF
import sqlite3

personGroupId = 'user'
arg1 = 'user88'

Key = 'my_subscription_key'
CF.Key.set(Key)
BASE_URL = 'my_base_url'
CF.BaseUrl.set(BASE_URL)
if len(sys.argv) is not 1:
res = CF.person.create(personGroupId, str(arg1))
print(res)
extractId = str(sys.argv[1])[-2:]
connect = sqlite3.connect("Face-DataBase")
cmd = "SELECT * FROM Students WHERE ID = " + extractId
cursor = connect.execute(cmd)
isRecordExist = 0
for row in cursor: # checking wheather the id exist or not
isRecordExist = 1
if isRecordExist == 1: # updating name and roll no
connect.execute("UPDATE Students SET personID = ? WHERE ID = ?",(res['personId'], extractId))
connect.commit() # commiting into the database
connect.close()
print("Person ID successfully added to the database")`

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.