Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

FaceType.py 1.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
  1. from enum import IntEnum
  2. class FaceType(IntEnum):
  3. #enumerating in order "next contains prev"
  4. HALF = 0
  5. MID_FULL = 1
  6. FULL = 2
  7. FULL_NO_ALIGN = 3
  8. WHOLE_FACE = 4
  9. HEAD = 10
  10. HEAD_NO_ALIGN = 20
  11. MARK_ONLY = 100, #no align at all, just embedded faceinfo
  12. @staticmethod
  13. def fromString (s):
  14. r = from_string_dict.get (s.lower())
  15. if r is None:
  16. raise Exception ('FaceType.fromString value error')
  17. return r
  18. @staticmethod
  19. def toString (face_type):
  20. return to_string_dict[face_type]
  21. to_string_dict = { FaceType.HALF : 'half_face',
  22. FaceType.MID_FULL : 'midfull_face',
  23. FaceType.FULL : 'full_face',
  24. FaceType.FULL_NO_ALIGN : 'full_face_no_align',
  25. FaceType.WHOLE_FACE : 'whole_face',
  26. FaceType.HEAD : 'head',
  27. FaceType.HEAD_NO_ALIGN : 'head_no_align',
  28. FaceType.MARK_ONLY :'mark_only',
  29. }
  30. from_string_dict = { to_string_dict[x] : x for x in to_string_dict.keys() }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...