91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 78KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2021-06-07
  • 語言: Python
  • 標簽: python??imagea??

資源簡介

python imageAi 檢測物體坐標獲取

資源截圖

代碼片段和文件信息

#qq:448251593業余pythonc?ucos?Linux?物聯網
#需要安裝pip3?install?https://github.com/OlafenwaMoses/ImageAI/releases/download/2.0.2/imageai-2.0.2-py3-none-any.whl

from?imageai.Detection?import?objectDetection
import?os

pic_name=“b1“

execution_path?=?os.getcwd()

detector?=?objectDetection()
detector.setModelTypeAsRetinaNet()
detector.setModelPath(?os.path.join(execution_path??“resnet50_coco_best_v2.0.1.h5“))
detector.loadModel()
detections?=?detector.detectobjectsFromImage(input_image=os.path.join(execution_path??pic_name+“.jpg“)?output_image_path=os.path.join(execution_path??pic_name+“new.jpg“))

for?eachobject?in?detections:
????print(eachobject[“name“]?+?“?:?“?+?str(eachobject[“percentage_probability“]))
????print(“x1?=?“?+?str(eachobject[“box_points“][0]))
????print(“y1?=?“?+?str(eachobject[“box_points“][1]))
????print(“x2?=?“?+?str(eachobject[“box_points“][2]))
????print(“y2?=?“?+?str(eachobject[“box_points“][3]))
????print(“--------------------------------“)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????21561??2019-04-19?11:45??b1.jpg
?????文件???????60712??2019-04-20?14:28??b1new.jpg
?????文件????????1016??2019-04-20?14:33??FirstobjectDetection.py

評論

共有 條評論