当前位置: 首页 > news >正文

网站案例模板山西省建设厅勘察设计协会网站

网站案例模板,山西省建设厅勘察设计协会网站,wordpress 头像设置,做分析图网站《Keras 3 :使用 Vision Transformers 进行物体检测》 作者:Karan V. Dave 创建日期:2022 年 3 月 27 日最后修改时间:2023 年 11 月 20 日描述:使用 Vision Transformer 进行对象检测的简单 Keras 实现。 (i) 此示例使用 Keras 3 在 Colab 中查看 GitHub 源 介绍 A…《Keras 3 :使用 Vision Transformers 进行物体检测》 作者:Karan V. Dave 创建日期:2022 年 3 月 27 日最后修改时间:2023 年 11 月 20 日描述:使用 Vision Transformer 进行对象检测的简单 Keras 实现。 (i) 此示例使用 Keras 3 在 Colab 中查看 GitHub 源 介绍 Alexey Dosovitskiy 等人的文章Vision Transformer (ViT)架构。 表明直接应用于图像序列的纯 transformer 补丁可以在对象检测任务中表现良好。 在这个 Keras 示例中,我们实现了一个对象检测 ViT 我们在加州理工学院 101 数据集上对其进行训练,以检测给定图像中的飞机。 导入和设置 import osos.environ["KERAS_BACKEND"] = "jax" # @param ["tensorflow", "jax", "torch"]import numpy as np import keras from keras import layers from keras import ops import matplotlib.pyplot as plt import numpy as np import cv2 import os import scipy.io import shutil准备数据集 我们使用加州理工学院 101 数据集。 # Path to images and annotations path_images = "./101_ObjectCategories/airplanes/" path_annot = "./Annotations/Airplanes_Side_2/"path_to_downloaded_file = keras.utils.get_file(fname="caltech_101_zipped",origin="https://data.caltech.edu/records/mzrjq-6wc02/files/caltech-101.zip",extract=True,archive_format="zip", # downloaded file formatcache_dir="/", # cache and extract in current directory ) download_base_dir = os.path.dirname(path_to_downloaded_file)# Extracting tar files found inside main zip file shutil.unpack_archive(os.path.join(download_base_dir, "caltech-101", "101_ObjectCategories.tar.gz"), "." ) shutil.unpack_archive(os.path.join(download_base_dir, "caltech-101", "Annotations.tar"), "." )# list of paths to images and annotations image_paths = [f for f in os.listdir(path_images) if os.path.isfile(os.path.join(path_images, f)) ] annot_paths = [f for f in os.listdir(path_annot) if os.path.isfile(os.path.join(path_annot, f)) ]image_paths.sort() annot_paths.sort()image_size = 224 # resize input images to this sizeimages, targets = [], []# loop over the annotations and images, preprocess them and store in lists for i in range(0, len(annot_paths)):# Access bounding box coordinatesannot = scipy.io.loadmat(path_annot + annot_paths[i])["box_coord"][0]top_left_x, top_left_y = annot[2], annot[0]bottom_right_x, bottom_right_y = annot[3], annot[1]image = keras.utils.load_img(path_images + image_paths[i],)(w, h) = image.size[:2]# resize imagesimage = image.resize((image_size, image_size))# convert image to array and append to listimages.append(keras.utils.img_to_array(image))# apply relative scaling to bounding boxes as per given image and append to listtargets.append((float(top_left_x) / w,float(top_left_y) / h,float(bottom_right_x) / w,float(bottom_right_y) / h,))# Convert the list to numpy array, split to train and test dataset (x_train), (y_train) = (np.asarray(images[: int(len(images) * 0.8)]),np.asarray(targets[: int(len(targets) * 0.8)]), ) (x_test), (y_test) = (np.asarray(images[int(len(images
http://www.hkea.cn/news/14582899/

相关文章:

  • 做网站需要注册吗wordpress 前端注册
  • 广东英德网站建设新网域名解析
  • 网站活动推广方案标准型网站建设
  • 网站怎么做前台跟后台的接口株洲网络学院
  • 西宁工程建设招聘信息网站entware wordpress
  • 如何解决网站兼容微信小游戏制作平台
  • 高端购物网站建设wordpress购买返现
  • 威海团购网站建设陕西铜川煤矿建设有限公司网站
  • 多个网站优化怎么做wordpress完整虚拟资源下载类源码
  • 洛宁网站建设网站备案在哪里
  • 网站制作算什么费用百度站长平台怎么验证网站
  • 企业网站推广的策略新龙华网站建设
  • 做智能家居网站四川住房和城乡建设厅网站主页
  • 金融网站开发公司wordpress自动安装插件
  • 为什么网站开发这么便宜农村网站建设的意义
  • 怎么设立网站河南seo技术教程
  • 网站建设简介是什么网络推广方案
  • 知乎网站建设入门书北京怎么做网站
  • 公司网站怎么建设设计公司网站
  • 网站制作公司去哪找优秀网站设计网站
  • 一个人可以做网站免费建站模板
  • 3liang 设计网站 源码wordpress分类目录 模版
  • 网站欢迎页面flash做家教的网站
  • 网站打不开怎么回事营销型网站的建设流程图
  • 建设银行手机银行网站登录wordpress批量上传图片
  • 如何查询网站备案信息能不能同行网站做站长统计
  • 怎么兼职做网站手机短视频网站的建设
  • 专业制作网站用哪些软件帝国cms资源网模板
  • 做网站推广个人做网站排版
  • 网站建设推广平台有哪些方面做动画的网站有哪些