123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import logging
- import os
- import cv2
- import numpy as np
- from image import read_json
- # size = np.array([[[500, 501, 502], [600, 601, 602], [100, 101, 102]],
- # [[500, 501, 502], [600, 601, 602], [100, 101, 102]],
- # [[500, 501, 502], [600, 601, 602], [100, 101, 102]]
- # ])
- # print(size.shape)
- # print(size[..., ::-1])
- # img, _, _ = read_json("train/dataset-line/2/train_0.json")
- # img.save('train_0.jpg')
- # with open('train_463.jpg', 'wb') as f:
- # f.write(img)
- # print(int(891.999999))
- #
- # _list = [[1, 2], [2, 3], [3, 4]]
- # delete_list = [[1, 2]]
- #
- # _list.remove(delete_list[0])
- # print(_list)
- #
- # size = (100, 1024)
- # image = np.zeros(size[::-1], dtype='uint8')
- # cv2.imshow("image", image)
- # cv2.waitKey(0)
- # image = cv2.imread("8.png")
- # ret, binary = cv2.threshold(image, 180, 255, cv2.THRESH_BINARY)
- # print("阈值:", ret)
- # cv2.imshow("binary", binary)
- # cv2.waitKey(0)
- # _image = [[1, 0, 1],
- # [0, 0, 0]
- # ]
- # _image = np.array(_image)
- # print(np.where(_image >= 1))
- # localPath = r"C:\Users\Administrator\Desktop\Test_ODPS\1623857120150.pdf"
- # max_file_size_mb = 2
- # if os.path.exists(localPath):
- # file_size_mb = int(os.path.getsize(localPath)/1024/1024)
- # print(file_size_mb)
- # if file_size_mb >= max_file_size_mb:
- # print("file size > " + str(max_file_size_mb))
- _str = "*" * 10
- print(_str)
|