当前位置: 首页 > 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://www.dtcms.com/wzjs/148135.html

相关文章:

  • 北京网站建设 shwl百度客服
  • 临沭县哪里有建网站的重庆百度关键词推广
  • fiverr找人做网站靠谱吗大亚湾发布
  • 网站开发仓库管理系统需求分析sem竞价托管费用
  • 陇南建设网站精准粉丝引流推广
  • 怎样给网站做 站内搜索宜兴百度推广公司
  • 如何利用网站模板做网站长沙公司网络营销推广
  • 北京网站建设需要花多少钱有什么平台可以推广
  • 电商网站首页图片此网站服务器不在国内维护
  • 网站维修合同优化课程体系
  • 怎样给网站做百度站长平台怎么用
  • 网站建设 培训江苏seo技术教程
  • 如何将音乐上传到wordpressseo网站营销推广公司
  • 威客类网站开发外贸网络推广怎么做
  • 湛江企业网站建设我想注册一个网站怎么注册
  • 北京网站制作公司转型方向网站设计费用
  • 个体工商户可以做网站备案吗360搜索推广
  • 做旅游网站的关注与回复上海专业seo排名优化
  • 商贸网站如何制作简单的网页链接
  • 蓝色为主的网站案例信阳seo公司
  • 委托第三方做网站如果保证用户数据搜狗网站收录入口
  • 营销型网站应用北京疫情太严重了
  • 网站已运行时间代码城市分站seo
  • 佛山新网站建设咨询河北网站seo策划
  • 米拓cms可以做企业网站吗北京网站优化对策
  • 服饰网站建设我国的网络营销公司
  • magento 做的最牛逼的中文网站seo网络贸易网站推广
  • 网站给我做坏了怎么办seo优化外包
  • 网站建设包括百度网络营销app下载
  • 中国建设人才网信息网站万词优化