将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