1 Star 10 Fork 3

qiaofengsheng/pytorch-yolov3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
utils.py 333 Bytes
一键复制 编辑 原始数据 按行查看 历史
qiaofengsheng 提交于 2022-01-13 23:29 . 2022年01月13日提交
from PIL import Image
def make_416_image(image_path):
img=Image.open(image_path)
w,h=img.size[0],img.size[1]
temp=max(w,h)
mask=Image.new(mode='RGB',size=(temp,temp),color=(0,0,0))
mask.paste(img,(0,0))
return mask
if __name__ == '__main__':
mask=make_416_image('data/images/000261.jpg')
mask.show()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/qiaofengsheng/pytorch-yolov3.git
git@gitee.com:qiaofengsheng/pytorch-yolov3.git
qiaofengsheng
pytorch-yolov3
pytorch-yolov3
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385