autoattendance-cognitive's Issues
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")`
It's not good to show your key.
Please set the env variable or some .env file to manage your personal access to cognitive computing.
Thanks!
Error 404: PersonGroupId Not found
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.
check this please
error in add_person_faces.py
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?
cognitive_face.util.CognitiveFaceException: Error when calling Cognitive Face API:
cognitive_face.util.CognitiveFaceException: Error when calling Cognitive Face API:
status_code: 401
code: Unspecified
message: Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key.
Please Check
Bro Please Help ๐ถ
Error when calling Cognitive Face API:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.