You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

utils.py 1.5 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import os
  2. import cv2
  3. def put_text(image, text, position, color):
  4. cv2.putText(
  5. image,
  6. text,
  7. position,
  8. cv2.FONT_HERSHEY_SIMPLEX,
  9. 0.45,
  10. color,
  11. 2,
  12. 1,
  13. )
  14. CI = os.environ.get("CI")
  15. CAMERA_WIDTH = 640
  16. CAMERA_HEIGHT = 480
  17. FONT = cv2.FONT_HERSHEY_SIMPLEX
  18. LABELS = [
  19. "person",
  20. "bicycle",
  21. "car",
  22. "motorcycle",
  23. "airplane",
  24. "bus",
  25. "train",
  26. "truck",
  27. "boat",
  28. "traffic light",
  29. "fire hydrant",
  30. "stop sign",
  31. "parking meter",
  32. "bench",
  33. "bird",
  34. "cat",
  35. "dog",
  36. "horse",
  37. "sheep",
  38. "cow",
  39. "elephant",
  40. "bear",
  41. "zebra",
  42. "giraffe",
  43. "backpack",
  44. "umbrella",
  45. "handbag",
  46. "tie",
  47. "suitcase",
  48. "frisbee",
  49. "skis",
  50. "snowboard",
  51. "sports ball",
  52. "kite",
  53. "baseball bat",
  54. "baseball glove",
  55. "skateboard",
  56. "surfboard",
  57. "tennis racket",
  58. "bottle",
  59. "wine glass",
  60. "cup",
  61. "fork",
  62. "knife",
  63. "spoon",
  64. "bowl",
  65. "banana",
  66. "apple",
  67. "sandwich",
  68. "orange",
  69. "broccoli",
  70. "carrot",
  71. "hot dog",
  72. "pizza",
  73. "donut",
  74. "cake",
  75. "chair",
  76. "couch",
  77. "potted plant",
  78. "bed",
  79. "dining table",
  80. "toilet",
  81. "tv",
  82. "laptop",
  83. "mouse",
  84. "remote",
  85. "keyboard",
  86. "cell phone",
  87. "microwave",
  88. "oven",
  89. "toaster",
  90. "sink",
  91. "refrigerator",
  92. "book",
  93. "clock",
  94. "vase",
  95. "scissors",
  96. "teddy bear",
  97. "hair drier",
  98. "toothbrush",
  99. ]