Coder Social home page Coder Social logo

Comments (11)

Rupesh-Ghimire avatar Rupesh-Ghimire commented on July 28, 2024 3

I get the subscription key from Microsoft Azure face api portal but still not working, same problem arise as mention above.

from autoattendance-cognitive.

crouched avatar crouched commented on July 28, 2024

Have you found the solution?

from autoattendance-cognitive.

harshmalik avatar harshmalik commented on July 28, 2024

You need to get the subscription key from Microsoft Azure face api portal

from autoattendance-cognitive.

AB96 avatar AB96 commented on July 28, 2024

I get the subscription key from Microsoft Azure face api portal but still not working, same problem arise as mention above.

HAVE you found the solution....

from autoattendance-cognitive.

Rupesh-Ghimire avatar Rupesh-Ghimire commented on July 28, 2024

from autoattendance-cognitive.

SiddhankNaik avatar SiddhankNaik commented on July 28, 2024

im also facing the same problem can someone help me out

from autoattendance-cognitive.

harshmalik avatar harshmalik commented on July 28, 2024

Add this line of code in everyfile where key is there
BASE_URL = 'https://westus.api.cognitive.microsoft.com/face/v1.0/' # Replace with your regional Base URL
CF.BaseUrl.set(BASE_URL)

from autoattendance-cognitive.

ragashvad avatar ragashvad commented on July 28, 2024

@harshmalik Bro i added those two lines but still facing the same error.Please share the edited piece of code if possible

from autoattendance-cognitive.

Rupesh-Ghimire avatar Rupesh-Ghimire commented on July 28, 2024

from autoattendance-cognitive.

SiddhankNaik avatar SiddhankNaik commented on July 28, 2024

@harshmalik after adding those 2 lines I got error like this
Traceback (most recent call last):
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/util/connection.py", line 57, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 732, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
conn.connect()
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connection.py", line 301, in connect
conn = self._new_conn()
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f49fe678be0>: Failed to establish a new connection: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='india.api.cognitive.microsoft.com', port=443): Max retries exceeded with url: /face/v1.0/persongroups/test1/persons (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f49fe678be0>: Failed to establish a new connection: [Errno -2] Name or service not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "create_person.py", line 12, in
res = CF.person.create(personGroupId, str(sys.argv[1]))
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/cognitive_face/person.py", line 71, in create
return util.request('POST', url, json=json)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/cognitive_face/util.py", line 92, in request
headers=headers)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/saurabh/.virtualenvs/cv/lib/python3.5/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='india.api.cognitive.microsoft.com', port=443): Max retries exceeded with url: /face/v1.0/persongroups/test1/persons (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f49fe678be0>: Failed to establish a new connection: [Errno -2] Name or service not known',))

can you help me out

from autoattendance-cognitive.

Rupesh-Ghimire avatar Rupesh-Ghimire commented on July 28, 2024

After adding those line on the code, i still get the problem listed below.

Traceback (most recent call last):
File "/home/rupesh/PycharmProjects/Autoattendance-Cognitive-master/identify.py", line 37, in
res = CF.face.detect(imgurl)
File "/home/rupesh/PycharmProjects/Face_Recognition_Classroom_attendence/venv/lib/python3.6/site-packages/cognitive_face/face.py", line 41, in detect
'POST', url, headers=headers, params=params, json=json, data=data)
File "/home/rupesh/PycharmProjects/Face_Recognition_Classroom_attendence/venv/lib/python3.6/site-packages/cognitive_face/util.py", line 105, in request
error_msg.get('message'))
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.

from autoattendance-cognitive.

Related Issues (10)

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.