摘要:$ cat draw_bbox.py import os import cv2 label_dir = "./resize_label/" image_dir = "./resize_img/" for image in os.listdir(image_dir): #print(image) im
阅读全文
摘要:# cat resize_label_640_480_PIL.py import os import cv2 #import pandas as pd w = 640 h = 480 images = "./images/" for next_image in os.listdir(images):
阅读全文
摘要:#!/usr/bin/env python # -*- coding: utf-8 -*- import os import shutil image_root = "./train2017" label_root = "./labels" no_label = "./no_label" image
阅读全文
摘要:image_cnt=0 class SSDDataAugmentation: def __init__(self, img_height=300, img_width=300, background=(123, 117, 104), labels_format={'class_id': 0, 'xm
阅读全文
摘要:>>> import numpy as np >>> a = np.array([[1,2,3],[4,5,6],[7,8,9]]) >>> a array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]) >>> print("the label is",a) ('the la
阅读全文
摘要:import os link = "./" for i in os.listdir(link): with open(i, "r") as f: #f.read() for line in f.readlines(): line = line.strip() print(line)
阅读全文
摘要:import os import shutil link = './' target = "./pw/" for i in os.listdir(link): if i.endswith('.sh'): print(i) new = i.replace("dw","pw") print(new) i
阅读全文
摘要:import os link = './' def alter(file,old_str,new_str): file_data = "" with open(file, "r" ) as f: for line in f: if old_str in line: line = line.repla
阅读全文
摘要:https://datatofish.com/jpeg-to-png-python/ from PIL import Image import os jpg_dir = "./2020_jpg/" png_dir = "./2020_png/" for f in os.listdir(jpg_dir
阅读全文
摘要:import tensorflow as tf import os tf_dir = './tfrecords_304_304_PIL_test' tf_list = [os.path.join(tf_dir,f) for f in os.listdir(tf_dir) ] print("tfrec
阅读全文
摘要:.>>> import h5py >>> file_name = "resnet_003.hdf5" >>> f = h5py.File(file_name, 'r') >>> group=f["model_weights"] >>> for key in group.keys(): ... pri
阅读全文
摘要:from __future__ import print_function import tensorflow as tf import os import shutil tf_dir = '../generate_tfrecord_by_me_part' tf_list = [os.path.jo
阅读全文
摘要:# cat check_no_label_jpg.py import os import shutil tf_dir = './JPEG_half' label_dir = './label' r = [] no_label_jpg = "./no_label_jpg/" #tf_list = [o
阅读全文
摘要:https://blog.csdn.net/lanchunhui/article/details/70160039 >> import iva >> iva.__file__ '/usr/local/lib/python2.7/dist-packages/iva/__init__.pyc' http
阅读全文
摘要:~/dataset/flir_dataset/FLIR_ADAS_1_3/train$ cat 1028.py import json js_file = './thermal_annotations.json' CLASS_NAME_MAP = { 1:'person', 2:'bicycle',
阅读全文
摘要:import json js_file = './thermal_annotations.json' with open(js_file,'r') as f: js = json.load(f) #print(label) label_info = js['info'] print(label_in
阅读全文
摘要:http://icejoywoo.github.io/2019/03/16/python-unhashable-type-error.html google: TypeError: unhashable type 为什么这三个类型是不支持哈希的?从哈希计算的方法上我们可以知道,对于可变的类型计算哈希
阅读全文
摘要:https://blog.csdn.net/u013733326/article/details/78096511
阅读全文
摘要:装饰器(decorator)可以给函数动态加上功能。 对于类的方法,装饰器一样起作用。Python内置的@property装饰器就是负责把一个方法变成属性。 直观点,搞了实例后,调用方法可以不加括号()。 另: https://blog.csdn.net/guofeng_hao/article/de
阅读全文
摘要:https://www.w3schools.com/python/python_classes.asp The self parameter is a reference to the current instance of the class, and is used to access vari
阅读全文