文章分类 -  python

上一页 1 2 3 4 5 下一页

Download from googledrive or others
摘要:#me@me:~/me/vision/torchvision/datasets$ cat utils.py import os import os.path import hashlib import gzip import errno import tarfile import zipfile from torch.utils.model_zoo import tqdm def ... 阅读全文

posted @ 2019-07-03 16:38 cdekelon 阅读(232) 评论(0) 推荐(0)

python 路径
摘要:https://leemendelowitz.github.io/blog/how-does-python-find-packages.html https://www.cnblogs.com/qingspace/p/5284480.html - 按照Python的约定,需要在animal文件夹中创 阅读全文

posted @ 2019-07-03 14:49 cdekelon 阅读(117) 评论(0) 推荐(0)

txt to json
摘要:flag = -1 frame = 0 point_id = 0 rc_file = './suzhou_0508.txt' with open(rc_file,'r') as f: for line in f.readlines(): content = line.strip('\n') a = content.split(";") ... 阅读全文

posted @ 2019-05-10 13:02 cdekelon 阅读(145) 评论(0) 推荐(0)

json load 不成功 ValueError: No JSON object could be decoded ==》 去掉bom 标记即可
摘要:https://692088846.iteye.com/blog/2005600 http://www.zhetenga.com/view/utf%208%E4%B8%AD%E7%9A%84bom%20u%2Bfeff%E4%B8%8Ejson%20decode%E9%94%99%E8%AF%AF- 阅读全文

posted @ 2019-04-23 11:33 cdekelon 阅读(296) 评论(0) 推荐(0)

lambda; sort the dict; save the dict
摘要:$ cat label_cal.py # count function; lambda; sort the dict; save the dict #https://www.cnblogs.com/wind-wang/p/6090708.html #https://www.cnblogs.com/wind-wang/p/6090708.html category = [] test = []... 阅读全文

posted @ 2019-04-18 14:23 cdekelon 阅读(83) 评论(0) 推荐(0)

如何判断一个列表中的元素是否在另一个列表中
摘要:如何判断一个列表中的元素是否在另一个列表中 From: https://blog.csdn.net/chenpe32cp/article/details/81945335 阅读全文

posted @ 2019-04-12 13:54 cdekelon 阅读(1669) 评论(0) 推荐(0)

理解 双字节HEX转为半精度浮点 np.frombuffer
摘要:>>> np.frombuffer(b'\x00\x3c\x11\x12', np.float32) array([4.582789e-28], dtype=float32) 参考 https://blog.csdn.net/seele52/article/details/8995486 Pytho 阅读全文

posted @ 2019-01-31 17:15 cdekelon 阅读(1241) 评论(0) 推荐(0)

read fp16 file
摘要:# read_fp16.py import numpy as np import cv2 import scipy.misc fp16_file = "./0.fp16" print("fp16_file is {}:".format(fp16_file)) image_test = np.fromfile(fp16_file) print("\nThe fp16 format imag... 阅读全文

posted @ 2019-01-30 17:52 cdekelon 阅读(141) 评论(0) 推荐(0)

Convert fp16 to png
摘要:Advanced version: 阅读全文

posted @ 2019-01-30 17:47 cdekelon 阅读(327) 评论(0) 推荐(0)

Convert raw to fp16
摘要:# cat rccb_to_fp16.py import numpy as np import cv2 import scipy.misc image_dir='./' img_height = 1208 #604 # Height of the model input images img_width = 1920 #960 # Width of the model input i... 阅读全文

posted @ 2019-01-30 17:42 cdekelon 阅读(182) 评论(0) 推荐(0)

Convert raw to png
摘要:import numpy as np import cv2 import scipy.misc image_dir='./' img_height = 604 #1208 #604 # Height of the model input images img_width = 960 #1920 #960 # Width of the model input images im... 阅读全文

posted @ 2019-01-30 17:14 cdekelon 阅读(234) 评论(0) 推荐(0)

好文章 about tfrecord
摘要:深入浅出的TensorFlow数据格式化存储工具TFRecord用法教程TFRecord是TensorFlow官方推荐使用的数据格式化存储工具,它不仅规范了数据的读写方式,还大大地提高了IO效率。 1.使用TFRecord的理由TFRecord内部使用了“Protocol Buffer”二进制数据编 阅读全文

posted @ 2019-01-25 11:24 cdekelon 阅读(119) 评论(0) 推荐(0)

Write tfrecord
摘要:import os import tensorflow as tf from PIL import Image import matplotlib.pyplot as plt import numpy as np import glob def convert_tfrecord_dataset(): cwd = os.getcwd() writer= tf.python_io.TF... 阅读全文

posted @ 2019-01-23 14:45 cdekelon 阅读(89) 评论(0) 推荐(0)

for i, num in enumerate(a)
摘要:改成下面,更容易理解 阅读全文

posted @ 2019-01-22 10:18 cdekelon 阅读(1680) 评论(0) 推荐(0)

numba
摘要:#Below is the sample to run numba benchmark #install and setting pip install numba export NUMBAPRO_LIBDEVICE=/usr/local/cuda/nvvm/libdevice export NUMBAPRO_NVVM=/usr/local/cuda/nvvm/lib64/libnvvm.so... 阅读全文

posted @ 2019-01-11 10:36 cdekelon 阅读(250) 评论(0) 推荐(0)

Read_tfrecord.py
摘要:Read_tfrecord.py 阅读全文

posted @ 2019-01-10 17:57 cdekelon 阅读(153) 评论(0) 推荐(0)

Convert fp16 to jpg
摘要:import cv2 import numpy as np height = 64 # Height of the model input images width = 64 # Width of the model input images image_file = "5938dde6f51cd200a32e7608.fp16" image = np.fromfile(im... 阅读全文

posted @ 2019-01-10 17:39 cdekelon 阅读(159) 评论(0) 推荐(0)

How to check if the image is HWC or CHW?
摘要:Use below code to get each channel's array 阅读全文

posted @ 2019-01-10 17:17 cdekelon 阅读(380) 评论(0) 推荐(0)

check image's info (PIL, skimage, opencv)
摘要:Code: 阅读全文

posted @ 2019-01-09 16:25 cdekelon 阅读(119) 评论(0) 推荐(0)

read / write tfrecord file
摘要:https://blog.csdn.net/Jerr__y/article/details/78594786 阅读全文

posted @ 2019-01-03 15:27 cdekelon 阅读(74) 评论(0) 推荐(0)

上一页 1 2 3 4 5 下一页

导航