Skip to content

Commit 793d4dc

Browse files
committed
Updated examples
1 parent 230c21e commit 793d4dc

13 files changed

+32
-33
lines changed

examples/add_example_of_a_subject.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
DOMAIN: str = 'http://localhost'
2323
PORT: str = '8000'
24-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
24+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2525

2626
compre_face: CompreFace = CompreFace(DOMAIN, PORT, {
2727
"det_prob_threshold": 0.8
@@ -33,7 +33,7 @@
3333
face_collection: FaceCollection = recognition.get_face_collection()
3434

3535
# Image from local path.
36-
image: str = 'examples/common/jonathan-petit-unsplash.jpg'
36+
image: str = 'common/jonathan-petit-unsplash.jpg'
3737
subject: str = 'Jonathan Petit'
3838

3939
print(face_collection.add(image, subject))

examples/add_subject.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
from compreface import CompreFace
1818
from compreface.service import RecognitionService
19-
from compreface.collections import SubjectCollection
19+
from compreface.collections import Subjects
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT)
2626

2727
recognition: RecognitionService = compre_face.init_face_recognition(RECOGNITION_API_KEY)
2828

29-
subject_collection: SubjectCollection = recognition.get_subject_collection()
29+
subjects: Subjects = recognition.get_subjects()
3030

3131
subject: str = 'Test Subject'
3232

33-
print(subject_collection.add(subject))
33+
print(subjects.add(subject))
-2.69 MB
Loading

examples/delete_all_examples_of_subject.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525

2626
compre_face: CompreFace = CompreFace(DOMAIN, PORT)

examples/delete_all_subjects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
from compreface import CompreFace
1818
from compreface.service import RecognitionService
19-
from compreface.collections import SubjectCollection
19+
from compreface.collections import Subjects
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT)
2626

2727
recognition: RecognitionService = compre_face.init_face_recognition(RECOGNITION_API_KEY)
2828

29-
subject_collection: SubjectCollection = recognition.get_subject_collection()
29+
subjects: Subjects = recognition.get_subjects()
3030

31-
print(subject_collection.delete_all())
31+
print(subjects.delete_all())

examples/delete_example_by_id.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525

2626
compre_face: CompreFace = CompreFace(DOMAIN, PORT)

examples/delete_subject_by_name.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
from compreface import CompreFace
1818
from compreface.service import RecognitionService
19-
from compreface.collections import SubjectCollection
19+
from compreface.collections import Subjects
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT)
2626

2727
recognition: RecognitionService = compre_face.init_face_recognition(RECOGNITION_API_KEY)
2828

29-
subject_collection: SubjectCollection = recognition.get_subject_collection()
29+
subjects: Subjects = recognition.get_subjects()
3030

3131
subject: str = 'Test Subject'
3232

33-
print(subject_collection.delete(subject))
33+
print(subjects.delete(subject))

examples/detect_face_from_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
DETECTION_API_KEY: str = '444dc40f-3168-43d5-8cca-108ab401ff5c'
23+
DETECTION_API_KEY: str = 'f4bdcf1f-1ef9-442f-863d-7bcd170723db'
2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT, {
2626
"limit": 0,
@@ -32,6 +32,6 @@
3232
detection: DetectionService = compre_face.init_face_detection(
3333
DETECTION_API_KEY)
3434

35-
image_path: str = 'examples/common/jonathan-petit-unsplash.jpg'
35+
image_path: str = 'common/jonathan-petit-unsplash.jpg'
3636

3737
print(detection.detect(image_path))

examples/get_list_of_all_subjects.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616

1717
from compreface import CompreFace
1818
from compreface.service import RecognitionService
19-
from compreface.collections import SubjectCollection
19+
from compreface.collections import Subjects
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525

2626
compre_face: CompreFace = CompreFace(DOMAIN, PORT)
2727

2828
recognition: RecognitionService = compre_face.init_face_recognition(
2929
RECOGNITION_API_KEY)
3030

31-
subject_collection: SubjectCollection = recognition.get_subject_collection()
31+
subjects: Subjects = recognition.get_subjects()
3232

33-
print(subject_collection.list())
33+
print(subjects.list())

examples/recognize_face_from_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
DOMAIN: str = 'http://localhost'
2121
PORT: str = '8000'
22-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
22+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2323

2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT, {
@@ -32,6 +32,6 @@
3232
recognition: RecognitionService = compre_face.init_face_recognition(
3333
RECOGNITION_API_KEY)
3434

35-
image_path: str = 'examples/common/jonathan-petit-unsplash.jpg'
35+
image_path: str = 'common/jonathan-petit-unsplash.jpg'
3636

3737
print(recognition.recognize(image_path))

examples/update_existing_subject.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616

1717
from compreface import CompreFace
1818
from compreface.service import RecognitionService
19-
from compreface.collections import SubjectCollection
19+
from compreface.collections import Subjects
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT)
2626

2727
recognition: RecognitionService = compre_face.init_face_recognition(RECOGNITION_API_KEY)
2828

29-
subject_collection: SubjectCollection = recognition.get_subject_collection()
29+
subjects: Subjects = recognition.get_subjects()
3030

3131
subject: str = 'Test Subject'
3232
new_name: str = 'Updated Subject'
3333

34-
print(subject_collection.update(subject, new_name))
34+
print(subjects.update(subject, new_name))

examples/verification_face_from_image.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
DOMAIN: str = 'http://localhost'
2222
PORT: str = '8000'
23-
RECOGNITION_API_KEY: str = 'b97fbc0a-518a-4b1d-a93a-581b1d3814cc'
23+
RECOGNITION_API_KEY: str = '00000000-0000-0000-0000-000000000002'
2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT, {
2626
"limit": 0,
@@ -31,7 +31,7 @@
3131
recognition: RecognitionService = compre_face.init_face_recognition(
3232
RECOGNITION_API_KEY)
3333

34-
image_path: str = 'examples/common/jonathan-petit-unsplash.jpg'
34+
image_path: str = 'common/jonathan-petit-unsplash.jpg'
3535

3636
face_collection: FaceCollection = recognition.get_face_collection()
3737

examples/verify_face_from_image.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
DOMAIN: str = 'http://localhost'
2121
PORT: str = '8000'
22-
VERIFICATION_API_KEY: str = '7aa288a2-9082-4fa2-a975-e175deba1ad2'
22+
VERIFICATION_API_KEY: str = '5c765423-4192-4fe8-9c60-092f495a332a'
2323

2424

2525
compre_face: CompreFace = CompreFace(DOMAIN, PORT, {
@@ -32,7 +32,6 @@
3232
verify: VerificationService = compre_face.init_face_verification(
3333
VERIFICATION_API_KEY)
3434

35-
image_path: str = 'examples/common/jonathan-petit-unsplash.jpg'
36-
35+
image_path: str = 'common/jonathan-petit-unsplash.jpg'
3736

3837
print(verify.verify(image_path, image_path))

0 commit comments

Comments
 (0)