فهرست منبع

优化AI识别

zhangdongming 1 سال پیش
والد
کامیت
3e827d7f40
1فایلهای تغییر یافته به همراه2 افزوده شده و 0 حذف شده
  1. 2 0
      Object/SageMakerAiObject.py

+ 2 - 0
Object/SageMakerAiObject.py

@@ -14,6 +14,7 @@ import time
 from io import BytesIO
 
 import boto3
+import cv2
 import numpy as np
 from PIL import Image
 
@@ -54,6 +55,7 @@ class SageMakerAiObject:
             img_list = map(BytesIO, img_list)
             img_list = map(Image.open, img_list)
             img_list = map(np.array, img_list)
+            img_list = map(lambda x: cv2.cvtColor(x, cv2.COLOR_RGB2BGR), img_list)
             img_list = np.array(list(img_list))
 
             nms_threshold = 0.45