1 Star 0 Fork 0

sml2h3/RotateCode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
angle_image.py 700 Bytes
一键复制 编辑 原始数据 按行查看 历史
bigload 提交于 2020-06-10 12:43 +08:00 . first commit
import cv2
import os
from utils import generate_rotated_image
import random
root_path="H:\\Downloads\\Compressed\\baidu_login\\some_demo"
create_path="H:\\Downloads\\Compressed\\baidu_login\\angle_demo"
filenames=os.listdir(root_path)
for filename in filenames:
image = cv2.imread(os.path.join(root_path,filename), 1)
h, w = image.shape[:2]
if h != 224 or w != 224:
image = cv2.resize(image, (224, 224), interpolation=cv2.INTER_CUBIC)
rotation_angle = random.randint(0,360)
rotated_image = generate_rotated_image(
image,
rotation_angle
)
cv2.imwrite(f"{create_path}\\{rotation_angle}_{filename}", rotated_image)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fkgeek/RotateCode.git
git@gitee.com:fkgeek/RotateCode.git
fkgeek
RotateCode
RotateCode
master

搜索帮助