Python数据科学_26_案例:基于CNN的人脸识别系统【计算机视觉】 发表于 2022-09-28 更新于 2023-03-09 分类于 技术 本文字数: 7.5k 阅读时长 ≈ 7 分钟 设置GPU123from tensorflow.config.experimental import list_physical_devices, set_memory_growthphysical_devices = list_physical_devices('GPU')set_memory_growth(physical_devices[0], True) 123456import osimport timeimport numpy as npimport matplotlib.pyplot as pltimport cv2import tqdm # 进度条工具 阅读全文 »
Python数据科学_25_案例:手写数字识别【计算机视觉】 发表于 2022-09-28 更新于 2023-03-09 分类于 技术 本文字数: 6.6k 阅读时长 ≈ 6 分钟 设置GPU12from tensorflow.config.experimental import list_physical_devices, set_memory_growthphysical_devices = list_physical_devices('GPU') 1physical_devices [PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] 1set_memory_growth(physical_devices[0], True) 阅读全文 »
Python数据科学_24_Tensorflow2(高阶API) 发表于 2022-09-28 更新于 2023-03-09 分类于 技术 本文字数: 98k 阅读时长 ≈ 1:29 高阶API准备数据1from sklearn.datasets import load_iris 1234x = load_iris()['data']y = load_iris()['target']print(x.shape)print(y.shape) (150, 4) (150,) 阅读全文 »
Python数据科学_23_Tensorflow2(中阶API) 发表于 2022-09-27 更新于 2022-09-28 分类于 技术 本文字数: 2.7k 阅读时长 ≈ 2 分钟 中阶API激活函数一般作用于单个神经元结构的输出,我们需要利用非线性激活函数向模型中引入非线性特征,用来拟合非线性数据 1from tensorflow.keras import activations 123# activations.sigmoid()# activations.relu()# activations.softmax() 阅读全文 »
Python数据科学_22_Tensorflow2(低阶API) 发表于 2022-09-26 更新于 2022-09-28 分类于 技术 本文字数: 14k 阅读时长 ≈ 12 分钟 12import tensorflow as tfimport numpy as np 12# 查看tensorflow2的版本,注意双下划线tf.__version__ '2.9.1' 12# 查看电脑GPU是否可用 cuda cudnntf.test.is_gpu_available() False 阅读全文 »
Python数据科学_21_案例:B站数据抓取【综合爬虫项目】 发表于 2022-09-25 更新于 2022-09-28 分类于 技术 本文字数: 12k 阅读时长 ≈ 11 分钟 获取单个视频发送get请求目标网址 1import requests 1url = 'https://www.bilibili.com/video/BV1bU4y1775K' 1response = requests.get(url) 阅读全文 »
Python数据科学_20_案例:今日头条表情包抓取【动态网页抓取】 发表于 2022-09-24 更新于 2022-09-28 分类于 技术 本文字数: 3.6k 阅读时长 ≈ 3 分钟 目标网址 经过对网页资源的分析,我们发现,今日头条表情包在网页中的加载方式有两种。 刚刚打开网页时得到的图片数据是静态加载的。 随着鼠标网页滑动又会动态的加载出其他的表情包。 说明:今日头条表情包的数据加载方式是有两种的,静态加载和动态加载。 阅读全文 »
Python数据科学_19_动态网页抓取 发表于 2022-09-23 更新于 2022-09-28 分类于 技术 本文字数: 6.4k 阅读时长 ≈ 6 分钟 获取华中杯首页最新通知标题1import requests 1url = 'http://hzbmmc.com:8080/jeecg-boot/api/v1/webbaseinfo/announcement/brief?mentTypehzbWebbaseinfoAnnounce=1&queryPage=1&querySize=5' 1response = requests.get(url) 阅读全文 »
Python数据科学_18_案例:百度热搜电影TOP30电影信息抓取【静态网络爬虫】 发表于 2022-09-22 更新于 2023-03-09 分类于 技术 本文字数: 12k 阅读时长 ≈ 11 分钟 1import requests 抓取页面内容1url = 'https://top.baidu.com/board?tab=movie' 1response = requests.get(url) 阅读全文 »
Python数据科学_17_Python网络爬虫基础 发表于 2022-09-21 更新于 2023-03-09 分类于 技术 本文字数: 24k 阅读时长 ≈ 22 分钟 1import requests 发送get请求12# 设置请求的网址url = "http://hzbmmc.com/" 12# 发送get请求response = requests.get(url) 12# 查看响应的状态码response.status_code 200 阅读全文 »