[DL]VDSR:Super-resolution with VDSR

2022-4-28 写技术

import os import sys import torch import torch.nn as nn import torch.nn.functional as F from PIL import Image,ImageFilter import matplotlib.pyplot as plt import numpy as np import torchvision from torchvision import transforms from torchvision.transforms import ToTensor from torchvision.t...

阅读全文>>

标签: python DL

评论(0) 浏览(641)

[python]Some anaconda commands

2022-3-12 写技术

conda create --name opencv python=3.9 conda info -e source activate opencv

阅读全文>>

标签: python

评论(1) 浏览(1280)

[python]Edit excel by xlrd and xlwt

2021-8-26 写技术

import xlrd import xlwt def edit_excel(fromFile, fromSheet): w_workbook = xlwt.Workbook() w_sheet = w_workbook.add_sheet("nicholas", cell_overwrite_ok=True) workbook = xlrd.open_workbook(fromFile) print(workbook.sheet_names()) sheet = workbook.sheet_names()[fromShe...

阅读全文>>

标签: python

评论(0) 浏览(843)

[python]Read excel by xlrd

2021-8-26 写技术

import xlrd def read_excel(fromFile, fromSheet): workbook = xlrd.open_workbook(fromFile) print(workbook.sheet_names()) sheet = workbook.sheet_names()[fromSheet] sheet = workbook.sheet_by_index(fromSheet) print(sheet) row = sheet.nrows col = sheet.ncols ...

阅读全文>>

标签: python

评论(0) 浏览(860)

[python]An example of get web page by selenium

2021-8-17 写技术

from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.key...

阅读全文>>

标签: python

评论(0) 浏览(778)

[python]Display image with matplot

2021-5-27 写技术

import matplotlib.pyplot as plt #plt.figure() img = plt.imread(image_path) plt.imshow(img) plt.show()

阅读全文>>

标签: python

评论(0) 浏览(1009)

[python]Python to read directorys and write sheet (excel)

2021-5-20 写技术

import os import xlwt def file_name(file_dir): for root, dirs, files in os.walk(file_dir): list_files(files) def list_files(files): workbook = xlwt.Workbook(encoding = 'utf-8') worksheet = workbook.add_sheet('Nicholas') lines = 1 for item in files: ...

阅读全文>>

标签: python

评论(0) 浏览(910)

[python]Gather all URLs from a certain web

2019-12-12 写技术

# encoding=utf8 import sys reload(sys) sys.setdefaultencoding('utf8') import urllib from bs4 import BeautifulSoup import urlparse import time import urllib2 url = "http://log.anycle.com" domain = "log.anycle.com" deep = 0 tmp = "" sites = set() visited = set() #local = set() ...

阅读全文>>

标签: python

评论(0) 浏览(1082)

[python]下标切片

2016-6-14 写技术

':'切片 Python下标是以0开始的 x[1:3]表示返回集合中下标1至3(不包括3)的元素集合 x[:3] 表示返回从开始到下标3(不包括3)的元素集合 x[3:]表示返回从下标3到结束的元素集合 即返回从开始下标到结束下标之间的集合(不包括结束下标)

阅读全文>>

标签: python

评论(0) 浏览(1358)

[python]k-近邻算法

2016-6-7 写技术

书上把kNN抄了一遍,跑起来爽爽的: from numpy import * import operator def createDataSet(): group = array([[1.0,1.1],[1.0,1.0],[0,0],[0,0.1]]) labels = ['A','A','B','B'] return group,labels def classify0(inX, dataSet, labels, k): dataSetSize = dataSet.shape[0] diffMat = tile(inX, (dataSetSize, ...

阅读全文>>

标签: python machine_learning

评论(0) 浏览(1408)

Powered by anycle 湘ICP备15001973号-1