將Bdd100k數據集轉為CoCo數據集


小可愛,加油噻~

添加上級目錄

import sys
sys.append('../..')

  這樣 from ... import 就會把加入的路徑要掃描噠

 

os.walk() 方法用於通過在目錄樹中游走輸出在目錄中的文件名,向上或者向下。

os.walk() 方法是一個簡單易用的文件、目錄遍歷器,可以幫助我們高效的處理文件、目錄方面的事情。

from PIL import image

  image.getcolors : 在 1.1.5 版本中新添加的。返回一個未排序列表,其元素是元組(count, color)。the count is the number of times the corresponding color occurs in the image 。If the maxcolors value is exceeded, the method stops counting and returns None。

填坑啦:

之前一直沒寫,今天正式填坑。

附代碼:

 

 數據截圖:

參考:

https://www.jianshu.com/p/bbad16822eab

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM