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

端掉一个wordpress网站免费推广网站大全下载安装

端掉一个wordpress网站,免费推广网站大全下载安装,上海做网站公司,小程序登录模板(一)启动 创建环境python3.9 打开此环境终端 (后面的语句操作几乎都在这个终端执行) 输入up主提供的语句:pip install -r requirements.txt 1.下载pytorch网络连接超时 pytorch网址: Start Locally | P…

(一)启动

创建环境python3.9

打开此环境终端

(后面的语句操作几乎都在这个终端执行)

输入up主提供的语句:pip install -r requirements.txt

1.下载pytorch网络连接超时

 pytorch网址:

Start Locally | PyTorch

把pip后面的3去掉

在上面的网址中找到对应的版本用那个下载语句 但是我开着魔法都下载失败了说是

网络连接超时问题

于是使用清华的镜像再次下载pytorch 飞速成功

pip install torch torchvision torchaudio -f https://pypi.tuna.tsinghua.edu.cn/simple
 

2.NVIDIA缺失

安装 cuda12.4

配置环境变量:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.4\bin添加到环境变量的PATH中

完成这步之后

输入nvida-smi后出现问题 大概就是我的C:\Program Files\NVIDIA Corporation这个路径下面没有NVSMI的文件夹

查询后解决: 感谢Windows NVIDIA Corporation下没有NVSMI文件夹解决方法-CSDN博客

链接:百度网盘 请输入提取码
提取码:wy6l

将NVSMI.zip解压后 放到C:\Program Files\NVIDIA Corporation\

然后再次回到你环境终端 输入nvdia-smi 发现这个电脑没有显卡

无所谓 让我们继续下一步

3.python app.py报错缺乏gradio

Traceback (most recent call last): File "D:\ai训练\yolov10\yolov10\app.py", line 1, in <module> import gradio as gr ModuleNotFoundError: No module named 'gradio'

那下载一个就是

再次 输入语句运行发现报错:

Exception in ASGI application Traceback (most recent call last): File "C:\ProgramData\anaconda3\envs\yolov10\lib\site-packages\pydantic\type_adapter.py", line 270, in _init_core_attrs self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__') File "C:\ProgramData\anaconda3\envs\yolov10\lib\site-packages\pydantic\type_adapter.py", line 112, in _getattr_no_parents raise AttributeError(attribute) AttributeError: __pydantic_core_schema_

ok啊依赖冲突了 降低版本

pip install pydantic==1.10.9 

解决 这里的问题就ok了 

4.运行了之后发现网页内容不是教程给的文件夹的内容

在yolov10中找到app.py

打开并且来到最后一行

app.launch(server_port=7861)

更改端口号为7861

原因:此前按照教程用默认端口7860自己先跑了一遍官方的 

5.第4的解决并不稳定

解决:

在yolov10和bin目录同级新建一个models

把文件夹中的所有.pt文件都放进去

然后打开app.py

import gradio as gr
import cv2
import tempfile
from ultralytics import YOLOv10
import os

# Set no_proxy environment variable for localhost
os.environ["no_proxy"] = "localhost,127.0.0.1,::1"

# Directory where your models are store
MODEL_DIR = 'D:/ai_train/yolov10/yolov10/models/'

# Load all available models from the directory
def get_model_list():
    return [f for f in os.listdir(MODEL_DIR) if f.endswith('.pt')]

def yolov10_inference(image, video, model_id, image_size, conf_threshold):
    model_path = os.path.join(MODEL_DIR, model_id)  # Get the full model path
    model = YOLOv10(model_path)  # Load the selected model

    if image:
        results = model.predict(source=image, imgsz=image_size, conf=conf_threshold)
        annotated_image = results[0].plot()
        return annotated_image[:, :, ::-1], None
    else:
        video_path = tempfile.mktemp(suffix=".webm")
        with open(video_path, "wb") as f:
            with open(video, "rb") as g:
                f.write(g.read())

        cap = cv2.VideoCapture(video_path)
        fps = cap.get(cv2.CAP_PROP_FPS)
        frame_width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
        frame_height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))

        output_video_path = tempfile.mktemp(suffix=".webm")
        out = cv2.VideoWriter(output_video_path, cv2.VideoWriter_fourcc(*'vp80'), fps, (frame_width, frame_height))

        while cap.isOpened():
            ret, frame = cap.read()
            if not ret:
                break

            results = model.predict(source=frame, imgsz=image_size, conf=conf_threshold)
            annotated_frame = results[0].plot()
            out.write(annotated_frame)

        cap.release()
        out.release()

        return None, output_video_path


def yolov10_inference_for_examples(image, model_path, image_size, conf_threshold):
    annotated_image, _ = yolov10_inference(image, None, model_path, image_size, conf_threshold)
    return annotated_image


def app():
    with gr.Blocks():
        with gr.Row():
            with gr.Column():
                image = gr.Image(type="pil", label="Image", visible=True)
                video = gr.Video(label="Video", visible=False)
                input_type = gr.Radio(
                    choices=["Image", "Video"],
                    value="Image",
                    label="Input Type",
                )
                
                # Dynamically load models from the directory
                model_id = gr.Dropdown(
                    label="Model",
                    choices=get_model_list(),  # Dynamically fetch the model list
                    value=get_model_list()[0],  # Set a default model
                )
                
                image_size = gr.Slider(
                    label="Image Size",
                    minimum=320,
                    maximum=1280,
                    step=32,
                    value=640,
                )
                conf_threshold = gr.Slider(
                    label="Confidence Threshold",
                    minimum=0.0,
                    maximum=1.0,
                    step=0.05,
                    value=0.25,
                )
                yolov10_infer = gr.Button(value="Detect Objects")

            with gr.Column():
                output_image = gr.Image(type="numpy", label="Annotated Image", visible=True)
                output_video = gr.Video(label="Annotated Video", visible=False)

        def update_visibility(input_type):
            image = gr.update(visible=True) if input_type == "Image" else gr.update(visible=False)
            video = gr.update(visible=False) if input_type == "Image" else gr.update(visible=True)
            output_image = gr.update(visible=True) if input_type == "Image" else gr.update(visible(False))
            output_video = gr.update(visible=False) if input_type == "Image" else gr.update(visible=True)

            return image, video, output_image, output_video

        input_type.change(
            fn=update_visibility,
            inputs=[input_type],
            outputs=[image, video, output_image, output_video],
        )

        def run_inference(image, video, model_id, image_size, conf_threshold, input_type):
            if input_type == "Image":
                return yolov10_inference(image, None, model_id, image_size, conf_threshold)
            else:
                return yolov10_inference(None, video, model_id, image_size, conf_threshold)


        yolov10_infer.click(
            fn=run_inference,
            inputs=[image, video, model_id, image_size, conf_threshold, input_type],
            outputs=[output_image, output_video],
        )

        gr.Examples(
            examples=[
                [
                    "ultralytics/assets/bus.jpg",
                    get_model_list()[0],
                    640,
                    0.25,
                ],
                [
                    "ultralytics/assets/zidane.jpg",
                    get_model_list()[0],
                    640,
                    0.25,
                ],
            ],
            fn=yolov10_inference_for_examples,
            inputs=[
                image,
                model_id,
                image_size,
                conf_threshold,
            ],
            outputs=[output_image],
            cache_examples='lazy',
        )

gradio_app = gr.Blocks()
with gradio_app:
    gr.HTML(
        """
    <h1 style='text-align: center'>
    YOLOv10: Real-Time End-to-End Object Detection
    </h1>
    """)
    gr.HTML(
        """
        <h3 style='text-align: center'>
        <a href='https://arxiv.org/abs/2405.14458' target='_blank'>arXiv</a> | <a href='https://github.com/THU-MIG/yolov10' target='_blank'>github</a>
        </h3>
        """)
    with gr.Row():
        with gr.Column():
            app()
if __name__ == '__main__':
    gradio_app.launch(server_port=7861)
 

重点是第十一行

把这个路径更改为你的models的文件夹路劲

然后回到py3.9的运行终端再次输入 app..py打开网页

解决了 一切正常 let`s 学习

(二)之后的错误

1.启动摄像头报错

(yolov10) D:\ai_train\yolov10\yolov10>python yolov10-camera.py Traceback (most recent call last): File "D:\ai_train\yolov10\yolov10\yolov10-camera.py", line 2, in <module> import supervision as sv ModuleNotFoundError: No module named 'supervision'

缺少 那就安装

pip install supervision

然后 再次启动

python yolov10-camera.py

2.桌面识别图片时报错

python yolov10-paint2.py SupervisionWarnings: BoundingBoxAnnotator is deprecated: `BoundingBoxAnnotator` is deprecated and has been renamed to `BoxAnnotator`. `BoundingBoxAnnotator` will be removed in supervision-0.26.0. 找不到窗口: th(1).jpg 找不到窗口: th(1).jpg 找不到窗口: th(1).jpg

解决;

直接复制图片窗口名字到yolov10-paint2.py第十七行 我就是手打然后报错了

(三)制作自己的模型遇到的错误

1.ModuleNotFoundError: No module named 'ultralytics'

 

那就安装 pip install ultralytics==8.3.0 指定版本8.3.0 因为我们的python版本是3.9

因为这个电脑没有显卡所有device=cpu

教程中device=0的意思是指定使用电脑中的第一块显卡  


文章转载自:
http://pomatum.xkzr.cn
http://lbj.xkzr.cn
http://ratafee.xkzr.cn
http://pariahdom.xkzr.cn
http://thanatophobia.xkzr.cn
http://sinapine.xkzr.cn
http://anharmonic.xkzr.cn
http://canine.xkzr.cn
http://colistin.xkzr.cn
http://malocclusion.xkzr.cn
http://consistory.xkzr.cn
http://expressions.xkzr.cn
http://procurer.xkzr.cn
http://unneighbourly.xkzr.cn
http://capitally.xkzr.cn
http://insolvent.xkzr.cn
http://underdeveloped.xkzr.cn
http://electrosurgery.xkzr.cn
http://day.xkzr.cn
http://undetachable.xkzr.cn
http://subnitrate.xkzr.cn
http://repressor.xkzr.cn
http://hearken.xkzr.cn
http://avitaminosis.xkzr.cn
http://ferrozirconium.xkzr.cn
http://watershoot.xkzr.cn
http://gallicize.xkzr.cn
http://suboptimize.xkzr.cn
http://smokebell.xkzr.cn
http://actionable.xkzr.cn
http://discommodiousness.xkzr.cn
http://sonovox.xkzr.cn
http://choochoo.xkzr.cn
http://microcosmic.xkzr.cn
http://quarterfinalist.xkzr.cn
http://downside.xkzr.cn
http://ogival.xkzr.cn
http://rump.xkzr.cn
http://claret.xkzr.cn
http://neuromata.xkzr.cn
http://diversion.xkzr.cn
http://churchy.xkzr.cn
http://uncharitable.xkzr.cn
http://cirsotomy.xkzr.cn
http://libelous.xkzr.cn
http://nucleoplasm.xkzr.cn
http://objectivize.xkzr.cn
http://canadian.xkzr.cn
http://theist.xkzr.cn
http://separative.xkzr.cn
http://colaholic.xkzr.cn
http://clostridium.xkzr.cn
http://pygmaean.xkzr.cn
http://faconne.xkzr.cn
http://camphorate.xkzr.cn
http://oceanological.xkzr.cn
http://turnout.xkzr.cn
http://cerebritis.xkzr.cn
http://abbevillian.xkzr.cn
http://arts.xkzr.cn
http://caponette.xkzr.cn
http://cleanser.xkzr.cn
http://biomathcmatics.xkzr.cn
http://unreadable.xkzr.cn
http://altogether.xkzr.cn
http://nailhole.xkzr.cn
http://modulability.xkzr.cn
http://shaddock.xkzr.cn
http://thermohaline.xkzr.cn
http://incuriosity.xkzr.cn
http://cultrate.xkzr.cn
http://tress.xkzr.cn
http://thin.xkzr.cn
http://seabird.xkzr.cn
http://hairweaving.xkzr.cn
http://preestablish.xkzr.cn
http://properly.xkzr.cn
http://wantonly.xkzr.cn
http://demolish.xkzr.cn
http://lueshite.xkzr.cn
http://june.xkzr.cn
http://cobalt.xkzr.cn
http://seronegative.xkzr.cn
http://thrace.xkzr.cn
http://dhaka.xkzr.cn
http://euploid.xkzr.cn
http://degage.xkzr.cn
http://hydrodynamics.xkzr.cn
http://nuque.xkzr.cn
http://fermium.xkzr.cn
http://sahaptian.xkzr.cn
http://preponderance.xkzr.cn
http://ground.xkzr.cn
http://proslavery.xkzr.cn
http://lochage.xkzr.cn
http://overspend.xkzr.cn
http://aeolic.xkzr.cn
http://ambo.xkzr.cn
http://septet.xkzr.cn
http://flench.xkzr.cn
http://www.15wanjia.com/news/91061.html

相关文章:

  • 官方网站建设合同torrentkitty磁力官网
  • 中山市区做网站公司seo推广平台
  • 食品网站设计欣赏做营销型网站的公司
  • 网站建设中模google翻译
  • 汽车网站建设模板正规的代运营公司
  • 广州番禺区疫情最新动态优化营商环境 助推高质量发展
  • 做网站税费接广告推广
  • 电子商城平台网站开发今日军事新闻头条
  • 做塑胶网站需要什么青岛网站seo公司
  • 佛山外贸网站建设方案seo 工具推荐
  • 哪些网站做简历合适今日国内新闻头条大事
  • 外贸b2c平台都有哪些网站管理微信软件
  • 设计师自己的网站网页开发用什么软件
  • 黑马程序员就业情况seo关键词排名优化要多少钱
  • 网站运营建站优化专家今日新闻头条热点
  • 百度推广需要先做网站吗中国最新消息新闻
  • 白名单企业百度怎么优化关键词排名
  • 兰州网站设计最佳效果百度广告投放
  • netbeans做网站二级域名免费申请
  • 网站建设的准备工作什么是网站外链
  • 一个人做网站 优帮云云速seo百度点击
  • 湖州外贸网站建设云南网站建设快速优化
  • 手机网站进不去怎么解决今日重大事件
  • 向客户介绍网站建设的话本百度数据分析
  • 直播网站app下载网站模板源码
  • 做网站seo优化总结打开百度
  • 相关网站建设网站建设规划要点详解
  • 珍爱网征婚免费下载如何对seo进行优化
  • 迈创网站建设网站制作公司官网
  • 网站数据库建设方案网页设计图片