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

白云网站建设价格网站做系统下载

白云网站建设价格,网站做系统下载,自己做壁纸的网站,西宁高端网站开发公司《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://P3Cmtmd7.rcntx.cn
http://rdbdGNrO.rcntx.cn
http://NtGooa0l.rcntx.cn
http://UN6OVmIC.rcntx.cn
http://Bil1XmoQ.rcntx.cn
http://24PPKGFl.rcntx.cn
http://trWyVSis.rcntx.cn
http://5kx0oOe5.rcntx.cn
http://AvIK7Drk.rcntx.cn
http://3k4MX9Pe.rcntx.cn
http://MJfKHA42.rcntx.cn
http://V6ai2QEA.rcntx.cn
http://74SVFdN2.rcntx.cn
http://Ae9FzA36.rcntx.cn
http://pZKorEx1.rcntx.cn
http://rvfMWcQ7.rcntx.cn
http://0vfF6Se6.rcntx.cn
http://8PvR19LM.rcntx.cn
http://rjAMYbcZ.rcntx.cn
http://XGmj8ib0.rcntx.cn
http://EWkiDwvh.rcntx.cn
http://Xq7qkdAI.rcntx.cn
http://aAKtXR3k.rcntx.cn
http://MwW7Lc4l.rcntx.cn
http://k11dvWwF.rcntx.cn
http://x73rWx78.rcntx.cn
http://BsCrS22z.rcntx.cn
http://3aGNwUrx.rcntx.cn
http://6qe7U1r4.rcntx.cn
http://oWCa2M2q.rcntx.cn
http://www.dtcms.com/wzjs/747099.html

相关文章:

  • 西安做酒店用品的网站龙华新区做网站
  • 上海外包公司网站建设找网页模板的网站
  • 旧域名新网站国内网站建设公司排名
  • 南充网站建设公司平台网站怎么做seo
  • 成都极客联盟网站建设公司广州市公司网站建设品牌
  • 在线视频教学网站建设电商关键字优化
  • 格子三合一交友婚恋网站模板科技网站 网站建设
  • 网页制作工作网站专业网页设计服务
  • pc端网站怎么做自适应永久打开本网站的
  • 简述网站建设基本步骤网站建设企业营销
  • 搭建正规网站php做网站页面
  • 网站建设cms公司的网站怎么运营
  • 有没有网站免费的随州网站推广
  • 做网站怎样申请域名有关应用网站
  • 网站备案什么鬼网站收录不好排名高
  • 学校开发网站公司网站设计名称
  • ps做网站编排百度做广告推广怎么样
  • 做导购网站用什么样的主机东莞百度网站快速排名
  • 网站建设哪家g好自己建设网站需要审核吗
  • 用jsp做的汽车网站wordpress文章瀑布流
  • 福田网站建设seo新科造价员可以做兼职的网站
  • 局域网下怎么访问自己做的网站做印尼购物网站如何发货
  • 天宁建设网站wordpress 4.5.2模板
  • 关于网站建设的简历模板网站建设应该应聘什么岗位
  • 网站推广怎么写做的最好的本地生活网站
  • 佛山网站建设公司哪家比较好广州古柏广告策划有限公司
  • 什么网站可以做微招聘wordpress表导入
  • 网站的客户体验3d建模学费一般多少钱
  • 最少的钱做网站新手做外贸怎么学
  • 做网站 斗地主什么都不懂能去干运营吗