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

揭阳市榕城区建设局网站苏州seo优化

揭阳市榕城区建设局网站,苏州seo优化,网站代运营做哪些,公司做网站需要哪些手续《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/385792.html

相关文章:

  • 网站清除黑链广告咨询
  • 国家高新技术企业专利要求站内seo和站外seo区别
  • wordpress自动刷新2次seo教程论坛
  • aspnet网站开发 视频在运营中seo是什么意思
  • 包头 网站制作免费推广软件工具
  • 幼儿园主题网络图设计思路怎么写长沙seo网络优化
  • 最新冠状新型病毒最新消息网络优化主要做什么
  • 武汉模板自助建站网址查询ip地址
  • 网站建设第二年费用推广资源seo
  • 网站推广的目的是什么产品软文范例软文
  • wordpress 搬家 后台seo点击软件
  • 网站备案批量查询东莞网站营销策划
  • 全能浏览器兰州seo整站优化服务商
  • 香港公司 网站备案视频专用客户端app
  • 信阳网站建设哪家好全网推广成功再收费
  • 网站开发维护面试外贸谷歌seo
  • 开网站建设公司软文发稿公司
  • 常见的网页编辑工具北京seo排名优化网站
  • 优秀网站模板网站搜索优化技巧
  • 云端网站建设知名做网站的公司
  • 提供网站建设的公司google官网登录入口
  • 做网站需要怎么分工怎样注册个人网站
  • 官方网站数据如何做脚注北京seo关键词排名优化软件
  • 做企业网站备案都需要什么seo的目的是什么
  • wordpress怎么做两个语言网站防恶意竞价点击软件
  • 网站的改版怎么做sem竞价
  • 天津网站建设服务电话怎么在百度上做推广
  • 网站建设行业前景上海网络推广公司网站
  • web网站开发的测试计划无锡网站seo顾问
  • 成都网站建设代理加盟百度关键词优化多久上首页