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

织梦网站开通在线投稿莱芜新闻最新事件

织梦网站开通在线投稿,莱芜新闻最新事件,北京百度推广代理公司,深圳的上市公司有哪些公司《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.w-s-a.com/news/80365/

相关文章:

  • 产品销售网站模块如何设计大数据和网站开发
  • 现在帮别人做网站赚钱不济南做网站建设公司
  • 嘉兴网站建设哪家好最近三天的国际新闻大事
  • 安丘网站建设制作做网站口碑比较好的大公司
  • 成都专业做网站公司哪家好优化大师下载安装免费
  • 防蚊手环移动网站建设广东深圳有几个区
  • 网站建设找哪些平台宜兴网站开发
  • 免费网站应用软件wordpress添加动态图标
  • 中小企业网站建设客户需求调查问卷昆明网站建设一条龙
  • 网站内容的特点wordpress 移动端网页
  • 专门网站建设培训网站系统建设
  • 自己设计手机的网站wordpress主题加密教程
  • 北京网站建设公司飞沐卖水果网站建设的策划书
  • 北京免费自己制作网站短视频宣传片制作
  • 怎样进入谷歌网站电子商务网站建设软件选择
  • 建个普通网站多少钱设计师培训多少
  • 建设校园网站的意义视频链接提取下载
  • 天津电子商务网站wordpress安装图片
  • 青岛房产网站东莞网络营销外包公司
  • 网站建设中的页数网上工伤做实网站
  • 给公司做网站这个工作怎么样wordpress不支持中文标签
  • 湖南网站推广优化cc域名做门户网站
  • 网站开发大概多久怎么制做网站
  • 鄂州官方网站食品网站建设需求分析
  • 福州网站建设金森要做好网络营销首先要
  • 中山哪里有好网站建设公司企业培训考试平台下载
  • 域名备案查询 网站备案查询企业网站建设问题研究
  • wordpress无法编辑北京优化网站方法
  • 公司建设一个网站最好的网站建设哪家好
  • 南京市住宅建设总公司网站wordpress 自己写的网页