import gradio as gr from openai import OpenAI from utils.utils import send_qwenvl, mathml2latex client = OpenAI( api_key="sk-86ec70f3845c46dd937f9827f9572b81", base_url="https://dashscope.aliyuncs.com/compatible-mode/v1", ) # Send Qwen2.5-72B-vl def submit_qwenvl(stem, analysis, score, student_answer, model): stem = mathml2latex(stem) analysis = mathml2latex(analysis) scoring = send_qwenvl(client, analysis, score, student_answer, model, stem) # Determine word problem return [stem, analysis, scoring] # Clean up input and output def clean(): return [None, None, None, None, None, 'qwen2.5-vl-72b-instruct'] type_chioes = ['llm', '多模态'] def update_dropdown(choice): if choice == 'llm': return [ ('72b', 'qwen2.5-72b-instruct'), ('32b', 'qwen2.5-32b-instruct'), ('14b', 'qwen2.5-14b-instruct'), ('7b', 'qwen2.5-7b-instruct'), ('3b', 'qwen2.5-3b-instruct'), ('1.5b', 'qwen2.5-1.5b-instruct'), ('0.5b', 'qwen2.5-0.5b-instruct') ] else: return [ ('72b', 'qwen2.5-vl-72b-instruct'), ('32b', 'qwen2.5-vl-32b-instruct'), ('7b', 'qwen2.5-vl-7b-instruct'), ('3b', 'qwen2.5-vl-3b-instruct') ] with gr.Blocks(title="测学练") as demo: gr.Markdown("<center><h1>测学练</h1></center>") with gr.Row(): # input with gr.Column(): with gr.Row(): type_choice = gr.Dropdown(label='类型', choices=type_chioes) model_choice = gr.Dropdown(label='模型') stem_input = gr.Textbox(label="题干", lines=5) analysis_input = gr.Textbox(label="标准答案", lines=5) score = gr.Slider(label="分值", minimum=1, maximum=50, step=1) student_answer = gr.Textbox(label="学生作答", lines=5) with gr.Row(): submit_btn = gr.Button(value="提交") clean_btn = gr.Button(value="清除") # output with gr.Column(): stem_output = gr.Textbox(label="题干", lines=5) analysis_output = gr.Textbox(label="标准答案", lines=5) scoring_output = gr.Text(label="评分结果") gr.on(triggers=[type_choice.change], fn=update_dropdown, inputs=type_choice, outputs=model_choice) submit_btn.click(fn=submit_qwenvl, inputs=[stem_input, analysis_input, score, student_answer, model_choice], outputs=[stem_output, analysis_output, scoring_output]) clean_btn.click(fn=clean, inputs=None, outputs=[stem_input, analysis_input, scoring_output, score, student_answer, model_choice]) demo.launch( server_name="0.0.0.0", server_port=7860, share=False )

时间: 2025-04-07 08:13:55 浏览: 160
<think>好的,我现在需要帮助用户理解他们提供的Gradio代码。首先,我会先通读整个代码,了解其结构和各个部分的功能。代码的主要目的是创建一个名为“测学练”的Web应用,用于评分学生答案,可能用于教育或测试场景。 首先,用户导入了必要的库:gradio和openai,还有一些自定义的工具函数,比如send_qwenvl和mathml2latex。这提示应用可能涉及到与OpenAI的API交互,特别是Qwen模型的不同版本,包括视觉语言模型(VL)。接下来,初始化了OpenAI客户端,但注意到base_url指向阿里云的地址,这可能说明使用的是定制或特定部署的模型服务。 然后,定义了一个submit_qwenvl函数,负责处理题干、标准答案、分数和学生答案,通过调用send_qwenvl函数来获取评分结果。这里用到了mathml2latex转换,可能用户输入的是MathML格式,需要转为LaTeX以便模型处理。 接下来是clean函数,用于清除输入输出内容。然后是update_dropdown函数,根据用户选择的类型(llm或多模态)更新模型下拉菜单的选项。这显示了界面允许用户选择不同的模型版本,可能根据任务需求选择适合的模型大小。 在Gradio的界面构建部分,使用了gr.Blocks来创建布局,包含输入和输出两个列。输入部分有类型选择、模型选择、题干、标准答案、分数滑块、学生作答输入框以及提交和清除按钮。输出部分显示处理后的题干、标准答案和评分结果。 事件处理部分,type_choice的变化触发update_dropdown,更新模型选项。提交按钮触发submit_qwenvl函数,清除按钮则调用clean函数。最后,应用启动在本地服务器的7860端口。 接下来,我需要将这些分析转化为用户容易理解的中文解释,分步骤说明各部分的功能,以及整个应用的工作流程。需要注意的是,用户可能对Gradio和OpenAI API的使用不太熟悉,所以需要用简洁的语言说明,同时保持结构清晰。 另外,需要检查是否有潜在的问题或改进点,比如API密钥硬编码在代码中,存在安全风险,应该提醒用户注意;或者模型版本的选择是否合理等。不过根据用户的问题,主要是介绍代码,可能不需要深入讨论这些,但如果有明显的问题,可以提及。 最后,确保回答符合用户要求的格式,特别是数学表达式使用$...$,但当前代码中似乎没有涉及数学内容,可能在send_qwenvl或mathml2latex中处理,但用户提供的代码中没有这部分细节。因此,在解释时不需要特别处理数学公式,除非在题干或答案中有涉及,但用户提供的示例代码中没有明显数学内容,所以可能不需要使用LaTeX格式。 总结回答的结构:先整体介绍应用用途,然后分解代码各部分的功能,包括导入库、OpenAI客户端设置、核心函数、界面布局、事件绑定,最后总结应用的工作流程和潜在注意事项。</think>这是一个基于Gradio构建的AI评分系统,主要用于处理数学类题目的自动评分。我分模块帮你解析代码结构和工作原理: $$\text{系统架构图:} \quad \text{用户界面} \rightarrow \text{处理逻辑} \rightarrow \text{Qwen大模型API}$$ 一、核心功能模块 1. **模型对接层**: - 使用阿里云部署的Qwen2.5系列大模型 - 支持两种类型模型: - 纯文本模型(`llm`):7种参数量可选(0.5B-72B) - 多模态模型(`vl`):4种参数量可选(3B-72B) - API密钥硬编码存在安全隐患(生产环境建议使用环境变量) 2. **数据处理流程**: ```mermaid graph TD A[用户输入题干] --> B[MathML转LaTeX] C[标准答案] --> B D[学生作答] --> E[模型评分] B --> E E --> F[返回评分结果] ``` 二、界面设计解析 $$\begin{cases} \text{输入侧} & \text{输出侧} \\ \hline • \text{题型选择下拉菜单} & • \text{标准题干展示} \\ • \text{动态模型选择器} & • \text{格式化答案展示} \\ • \text{滑动评分区间(1-50分)} & • \text{最终评分结果} \\ • \text{清除/提交按钮组} & \end{cases}$$ 三、关键技术点 1. **动态组件更新**: - 当用户切换`llm`/`多模态`类型时,使用`update_dropdown`函数实时更新可用模型列表 - 示例代码片段: ```python def update_dropdown(choice): return [ ('72b', 'qwen2.5-72b-instruct'), ... # 动态生成模型选项 ] ``` 2. **数学公式处理**: - 内置`mathml2latex`转换器,支持将MathML格式转换为LaTeX - 确保模型接收标准数学表达式,如:$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$ 四、系统运行方式 1. 本地启动命令: ```bash python app.py ``` 2. 访问地址: - 本地访问:http://localhost:7860 - 局域网访问:http://[服务器IP]:7860 五、改进建议 1. 安全性优化:建议通过环境变量注入API密钥 2. 错误处理:增加异常捕获机制,特别是API调用失败时的回退策略 3. 历史记录:添加评分记录存储功能,便于后续分析 这个系统适合教育机构用于: $$自动化批改 \propto \frac{\text{模型精度} \times \text{题目复杂度}}{\text{响应时间}}$$
阅读全文

相关推荐

import os import numpy as np import torch from PIL import Image from facenet import Facenet # 导入 Facenet 类 from utils.utils import resize_image, preprocess_input # 导入必要的工具函数 class FaceBank: def __init__(self, facebank_dir='facebank'): """ 初始化人脸数据库 :param facebank_dir: 人脸数据库存储路径 """ self.facebank_dir = facebank_dir self.facebank = {} # 人脸数据库,key 为文件名,value 为特征向量 self.model = Facenet() # 加载 FaceNet 模型 self.next_id = 0 # 人脸数据库中的下一个 ID # 如果 facebank 文件夹不存在,则创建 if not os.path.exists(self.facebank_dir): os.makedirs(self.facebank_dir) # 加载已有的人脸数据库 self.load_facebank() def load_facebank(self): """ 加载已有的人脸数据库 """ for filename in os.listdir(self.facebank_dir): if filename.endswith('.jpg') or filename.endswith('.png'): face_path = os.path.join(self.facebank_dir, filename) face_image = Image.open(face_path) face_feature = self.get_embedding(face_image) # 获取人脸特征向量 self.facebank[filename] = face_feature self.next_id = max(self.next_id, int(filename.split('.')[0]) + 1) def get_embedding(self, image): """ 获取人脸图像的特征向量 :param image: 人脸图像 (PIL.Image) :return: 特征向量 (numpy.ndarray) """ # 使用 Facenet 的 detect_image 方法获取特征向量 with torch.no_grad(): # 调整图像大小并预处理 image = resize_image(image, [self.model.input_shape[1], self.model.input_shape[0]], letterbox_image=self.model.letterbox_image) photo = torch.from_numpy(np.expand_dims(np.transpose(preprocess_input(np.array(image, np.float32)), (2, 0, 1)), 0)) if self.model.cuda: photo = photo.cuda() output = self.model.net(photo).cpu().numpy() return output def add_to_facebank(self, image): """ 将人脸图像加入数据库 :param image: 人脸图像 (PIL.Image

File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio/routes.py", line 615, in api_info api_info = utils.safe_deepcopy(app.get_blocks().get_api_info()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio/blocks.py", line 3019, in get_api_info python_type = client_utils.json_schema_to_python_type(info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 931, in json_schema_to_python_type type_ = _json_schema_to_python_type(schema, schema.get("$defs")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 976, in _json_schema_to_python_type elements = _json_schema_to_python_type(items, defs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 946, in _json_schema_to_python_type return _json_schema_to_python_type(defs[schema["$ref"].split("/")[-1]], defs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 985, in _json_schema_to_python_type des = [ ^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 986, in f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 998, in _json_schema_to_python_type desc = " | ".join([_json_schema_to_python_type(i, defs) for i in schema[type_]]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/llama_factory/lib/python3.11/site-packages/gradio_client/utils.py", line 998, in desc = " | ".join([_json_schema

运行以下代码时:import os import gradio as gr import requests from PyPDF2 import PdfReader import docx from docx import Document from datetime import datetime from typing import Union, Dict import ollama # --------------------- 文档解析模块 --------------------- def parse_folder(folder_path: str) -> str: """解析文件夹内所有支持的文档""" supported_ext = ['.pdf', '.docx', '.txt'] all_text = [] for root, _, files in os.walk(folder_path): for file in files: file_path = os.path.join(root, file) ext = os.path.splitext(file_path)[1].lower() try: if ext == '.pdf': reader = PdfReader(file_path) text = "\n".join([page.extract_text() for page in reader.pages]) elif ext == '.docx': doc = docx.Document(file_path) text = "\n".join([para.text for para in doc.paragraphs]) elif ext == '.txt': with open(file_path, 'r', encoding='utf-8') as f: text = f.read() else: continue all_text.append(f"【文档:{file}】\n{text}\n\n") except Exception as e: print(f"解析 {file_path} 失败: {str(e)}") return "\n".join(all_text)[:10000] # 限制总文本长度 # --------------------- 模型调用模块 --------------------- def analyze_with_deepseek(text: str) -> str: """调用本地Ollama服务进行分析""" prompt = f""" 请根据以下文档生成结构化的市场分析报告: {text[:3000]} """ try: response = ollama.generate( json={ "model": "deepseek-coder:6.7b", "messages": [{"role": "user", "content": prompt}], "stream": False, "options": { "temperature": 0.3, "max_tokens": 2000 } }, timeout=60 ) response.raise_for_status() return response.json()["choices"][0]["message"]["content"]

这是一个crossattention模块:class CrossAttention(nn.Module): def __init__(self, query_dim, context_dim=None, heads=8, dim_head=64, dropout=0.): super().__init__() inner_dim = dim_head * heads context_dim = default(context_dim, query_dim) self.scale = dim_head ** -0.5 self.heads = heads self.to_q = nn.Linear(query_dim, inner_dim, bias=False) self.to_k = nn.Linear(context_dim, inner_dim, bias=False) self.to_v = nn.Linear(context_dim, inner_dim, bias=False) self.to_out = nn.Sequential( nn.Linear(inner_dim, query_dim), nn.Dropout(dropout) ) def forward(self, x, context=None, mask=None): h = self.heads q = self.to_q(x) context = default(context, x) k = self.to_k(context) v = self.to_v(context) q, k, v = map(lambda t: rearrange(t, 'b n (h d) -> (b h) n d', h=h), (q, k, v)) # force cast to fp32 to avoid overflowing if _ATTN_PRECISION =="fp32": with torch.autocast(enabled=False, device_type = 'cuda'): q, k = q.float(), k.float() sim = einsum('b i d, b j d -> b i j', q, k) * self.scale else: sim = einsum('b i d, b j d -> b i j', q, k) * self.scale del q, k if exists(mask): mask = rearrange(mask, 'b ... -> b (...)') max_neg_value = -torch.finfo(sim.dtype).max mask = repeat(mask, 'b j -> (b h) () j', h=h) sim.masked_fill_(~mask, max_neg_value) # attention, what we cannot get enough of sim = sim.softmax(dim=-1) out = einsum('b i j, b j d -> b i d', sim, v) out = rearrange(out, '(b h) n d -> b n (h d)', h=h) return self.to_out(out) 我如何从中提取各个提示词的注意力热力图并用Gradio可视化?

To create a public link, set share=True in launch(). Building prefix dict from the default dictionary ... DEBUG:jieba:Building prefix dict from the default dictionary ... Loading model from cache C:\Users\LY-AI\AppData\Local\Temp\jieba.cache DEBUG:jieba:Loading model from cache C:\Users\LY-AI\AppData\Local\Temp\jieba.cache Loading model cost 0.715 seconds. DEBUG:jieba:Loading model cost 0.715 seconds. Prefix dict has been built successfully. DEBUG:jieba:Prefix dict has been built successfully. C:\Users\LY-AI\Desktop\AI\vits-uma-genshin-honkai\python3.9.13\3.9.13\lib\site-packages\gradio\processing_utils.py:183: UserWarning: Trying to convert audio automatically from float32 to 16-bit int format. warnings.warn(warning.format(data.dtype)) Traceback (most recent call last): File "C:\Users\LY-AI\Desktop\AI\vits-uma-genshin-honkai\python3.9.13\3.9.13\lib\site-packages\gradio\routes.py", line 442, in run_predict output = await app.get_blocks().process_api( File "C:\Users\LY-AI\Desktop\AI\vits-uma-genshin-honkai\python3.9.13\3.9.13\lib\site-packages\gradio\blocks.py", line 1392, in process_api data = self.postprocess_data(fn_index, result["prediction"], state) File "C:\Users\LY-AI\Desktop\AI\vits-uma-genshin-honkai\python3.9.13\3.9.13\lib\site-packages\gradio\blocks.py", line 1326, in postprocess_data prediction_value = block.postprocess(prediction_value) File "C:\Users\LY-AI\Desktop\AI\vits-uma-genshin-honkai\app.py", line 41, in audio_postprocess return gr.processing_utils.encode_url_or_file_to_base64(data['name']) AttributeError: module 'gradio.processing_utils' has no attribute 'encode_url_or_file_to_base64'

yolov12源代码自带的app.py为什么运行不了:ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 187, in __call__ raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\route_utils.py", line 761, in __call__ await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 714, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 734, in app await route.handle(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 288, in handle await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 301, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 214, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\concurrency.py", line 37, in run_in_threadpool return await anyio.to_thread.run_sync(func) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 431, in main gradio_api_info = api_info(False) ^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 460, in api_info app.api_info = app.get_blocks().get_api_info() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\blocks.py", line 2852, in get_api_info python_type = client_utils.json_schema_to_python_type(info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 893, in json_schema_to_python_type type_ = _json_schema_to_python_type(schema, schema.get("$defs")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 947, in _json_schema_to_python_type des = [ ^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 948, in f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 955, in _json_schema_to_python_type f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 901, in _json_schema_to_python_type type_ = get_type(schema) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 863, in get_type if "const" in schema: ^^^^^^^^^^^^^^^^^ TypeError: argument of type 'bool' is not iterable ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 187, in __call__ raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\route_utils.py", line 761, in __call__ await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 714, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 734, in app await route.handle(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 288, in handle await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 301, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 214, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\concurrency.py", line 37, in run_in_threadpool return await anyio.to_thread.run_sync(func) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 431, in main gradio_api_info = api_info(False) ^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 460, in api_info app.api_info = app.get_blocks().get_api_info() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\blocks.py", line 2852, in get_api_info python_type = client_utils.json_schema_to_python_type(info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 893, in json_schema_to_python_type type_ = _json_schema_to_python_type(schema, schema.get("$defs")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 947, in _json_schema_to_python_type des = [ ^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 948, in f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 955, in _json_schema_to_python_type f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 901, in _json_schema_to_python_type type_ = get_type(schema) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 863, in get_type if "const" in schema: ^^^^^^^^^^^^^^^^^ TypeError: argument of type 'bool' is not iterable ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 187, in __call__ raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\route_utils.py", line 761, in __call__ await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 714, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 734, in app await route.handle(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 288, in handle await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 301, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 214, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\concurrency.py", line 37, in run_in_threadpool return await anyio.to_thread.run_sync(func) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 431, in main gradio_api_info = api_info(False) ^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 460, in api_info app.api_info = app.get_blocks().get_api_info() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\blocks.py", line 2852, in get_api_info python_type = client_utils.json_schema_to_python_type(info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 893, in json_schema_to_python_type type_ = _json_schema_to_python_type(schema, schema.get("$defs")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 947, in _json_schema_to_python_type des = [ ^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 948, in f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 955, in _json_schema_to_python_type f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 901, in _json_schema_to_python_type type_ = get_type(schema) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 863, in get_type if "const" in schema: ^^^^^^^^^^^^^^^^^ TypeError: argument of type 'bool' is not iterable ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 187, in __call__ raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\route_utils.py", line 761, in __call__ await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 714, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 734, in app await route.handle(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 288, in handle await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 301, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 214, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\concurrency.py", line 37, in run_in_threadpool return await anyio.to_thread.run_sync(func) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 431, in main gradio_api_info = api_info(False) ^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 460, in api_info app.api_info = app.get_blocks().get_api_info() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\blocks.py", line 2852, in get_api_info python_type = client_utils.json_schema_to_python_type(info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 893, in json_schema_to_python_type type_ = _json_schema_to_python_type(schema, schema.get("$defs")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 947, in _json_schema_to_python_type des = [ ^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 948, in f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 955, in _json_schema_to_python_type f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 901, in _json_schema_to_python_type type_ = get_type(schema) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 863, in get_type if "const" in schema: ^^^^^^^^^^^^^^^^^ TypeError: argument of type 'bool' is not iterable ERROR: Exception in ASGI application Traceback (most recent call last): File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\protocols\http\h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\uvicorn\middleware\proxy_headers.py", line 60, in __call__ return await self.app(scope, receive, send) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\applications.py", line 1054, in __call__ await super().__call__(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\applications.py", line 112, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 187, in __call__ raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\errors.py", line 165, in __call__ await self.app(scope, receive, _send) File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\route_utils.py", line 761, in __call__ await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\middleware\exceptions.py", line 62, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 714, in __call__ await self.middleware_stack(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 734, in app await route.handle(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 288, in handle await self.app(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 76, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 53, in wrapped_app raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 301, in app raw_response = await run_endpoint_function( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\fastapi\routing.py", line 214, in run_endpoint_function return await run_in_threadpool(dependant.call, **values) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\starlette\concurrency.py", line 37, in run_in_threadpool return await anyio.to_thread.run_sync(func) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 2470, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\anyio\_backends\_asyncio.py", line 967, in run result = context.run(func, *args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 431, in main gradio_api_info = api_info(False) ^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\routes.py", line 460, in api_info app.api_info = app.get_blocks().get_api_info() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\blocks.py", line 2852, in get_api_info python_type = client_utils.json_schema_to_python_type(info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 893, in json_schema_to_python_type type_ = _json_schema_to_python_type(schema, schema.get("$defs")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 947, in _json_schema_to_python_type des = [ ^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 948, in f"{n}: {_json_schema_to_python_type(v, defs)}{get_desc(v)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 955, in _json_schema_to_python_type f"str, {_json_schema_to_python_type(schema['additionalProperties'], defs)}" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 901, in _json_schema_to_python_type type_ = get_type(schema) ^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio_client\utils.py", line 863, in get_type if "const" in schema: ^^^^^^^^^^^^^^^^^ TypeError: argument of type 'bool' is not iterable Traceback (most recent call last): File "G:\yfwh\yolov12-main\app.py", line 165, in <module> gradio_app.launch() File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\blocks.py", line 2465, in launch raise ValueError( ValueError: When localhost is not accessible, a shareable link must be created. Please set share=True or check your proxy settings to allow access to localhost. Exception in thread Thread-5 (_do_normal_analytics_request): Traceback (most recent call last): File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_transports\default.py", line 101, in map_httpcore_exceptions yield File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_transports\default.py", line 250, in handle_request resp = self._pool.handle_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_sync\connection_pool.py", line 256, in handle_request raise exc from None File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_sync\connection_pool.py", line 236, in handle_request response = connection.handle_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_sync\connection.py", line 101, in handle_request raise exc File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_sync\connection.py", line 78, in handle_request stream = self._connect(request) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_sync\connection.py", line 156, in _connect stream = stream.start_tls(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_backends\sync.py", line 154, in start_tls with map_exceptions(exc_map): File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions raise to_exc(exc) from exc httpcore.ConnectTimeout: _ssl.c:989: The handshake operation timed out The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\threading.py", line 1045, in _bootstrap_inner self.run() File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\threading.py", line 982, in run self._target(*self._args, **self._kwargs) File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\analytics.py", line 70, in _do_normal_analytics_request data["ip_address"] = get_local_ip_address() ^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\site-packages\gradio\analytics.py", line 131, in get_local_ip_address ip_address = httpx.get( ^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_api.py", line 195, in get return request( ^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_api.py", line 109, in request return client.request( ^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_client.py", line 825, in request return self.send(request, auth=auth, follow_redirects=follow_redirects) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_client.py", line 914, in send response = self._send_handling_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_client.py", line 942, in _send_handling_auth response = self._send_handling_redirects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_client.py", line 979, in _send_handling_redirects response = self._send_single_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_client.py", line 1014, in _send_single_request response = transport.handle_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_transports\default.py", line 249, in handle_request with map_httpcore_exceptions(): File "C:\Users\yanfwh\.conda\envs\yolov12\Lib\contextlib.py", line 158, in __exit__ self.gen.throw(typ, value, traceback) File "C:\Users\yanfwh\AppData\Roaming\Python\Python311\site-packages\httpx\_transports\default.py", line 118, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.ConnectTimeout: _ssl.c:989: The handshake operation timed out

大家在看

recommend-type

生成几何模型-实用非参数统计第三版

(2)设置不显示日期和时间 Utility Menu: PlotCtrls →Window Controls →Window Options→DATE DATE/TIME display: NO DATE or TIME (3) 定义材料参数 Main Menu: Preprocessor → Material Props → Material Models → Material Models Available → Structural(双击打开子菜单) → Linear(双击) → Elastic(双击) → Isotropic(双击) → EX: 7e10(弹性模量) , PRXY:0.288(泊松比) →Density:2700 OK → 关闭材料定义菜单(点击菜单的右上角 X) (4) 选择单元类型 Main Menu: Preprocessor → Element Type → Add/Edit/Delete → Add… → Library of element Types: Structural Solid, Quad 4node 42 → OK → Add → Library of element Types: Structural Solid, Brick 8node 45 →OK → Add → Library of Types: Structural Shell, Elastic 4node 63 →OK (5) 定义实常数 Main Menu: Preprocessor → Real Constants → Add/Edit/Delete → Add → Choose element type: Type3 Shell63 → OK → Real Constant Set No:1 (第 1 号实常数), Shell thickness at node I:0.005 node J: 0.005 node K: 0.05 node L: 0.05 (厚度) → OK → Close (6) 生成几何模型 Step1 生成六边形 Main Menu: Preprocessor → Modeling → Create →Areas → Polygon → Hexagon → WP X:0, WP Y:0, Radious: 0.4 → OK Step2 旋转工作平面 Utility Menu: WorkPlane →Offset WP by Increments → XY,YZ,ZX Angles:30 →OK   Step4 生成矩形 Main Menu→Preprocessor→Modeling→Create →Areas→Rectangle→By 2 Corners→WPX:0.3; WPY: -0.2 ;Width:1.8464, Hight:0.4 →OK   Step5 转换坐标系 Utility Menu: WorkPlane→Change Active CS to→Global Cylindrical   Step6 复制矩形 Main Menu: Preprocessor →Modeling →Copy →Areas→鼠标点击选择面 2,即帆板面 →OK number of copys:3 ;DY:120→OK   Step7 面搭接 Main Menu: Preprocessor →Modeling →Operate →Booleans →Overlap →Areas→ pick all →OK 应用实例 IV-4
recommend-type

power_svc_SVC仿真_svc_SVC仿真_matlabsimulink_

POWER_SVC 的simulink仿真,R2015a版本的。
recommend-type

Rosetta(附使用教程)

Rosetta软件+中文简易使用说明书+官方原版英文说明书,对于初学者和开发者都有一定的参考价值.
recommend-type

录音笔时间修改工具(同步文件/修改时间).rar

软件介绍: 专业录音笔配套工具说明:1、双击“专业录音笔配套工具”,运行中如有防火墙拦截请全部选择“允许”,并勾上“不在提醒”,此工具不是病毒,请放心使用。2、进入界面后按上面的说明进行操作,对录音笔进行维护处理。3、测试版目前还在测试阶段,可能运行过程中会产生不稳定的情况,属于正常,请大家重新运行,并欢迎对我们的工具提出意见。4、建议将此工具复制在桌面上,这样避免工具在录音笔中误操作删除。5、本工具需要winrar解压缩软件的支持,如无法运行请检测是否安装winrar软件。同步录音笔时钟工具:1.请用USB连接好录音笔,并确认电脑已经识别到可移动硬盘。2.录音笔连接USB时,请务必将录音笔的电源开机保持在【开】状态;如果在【关】的状态,在使用本工具设置时间退出USB后,设置可能无法保存。3.如果电脑连接多个USB设备,工具将无法设定录音笔的时间,因此设置录音笔时间时请确保有且仅有一个USB设备连接。4.部分录音笔机型在电源开关关闭后,机器自带时钟将自动复位,请在下次使用前再用此工具设置好时间。5.部分录音笔无法使用本软件设置时钟,请使用时间修改工具修改已经保存的录音文件。修改已保存录音文件时间:1.点击下面按钮开始修改录音文件时间。2.在弹出来的【文件属性修改王】中点击【浏览】。3.在新窗口中找到录音笔的录音文件存放目录,并选择好您要修改的录音文件名,例如【REC001.wav】,并点击【打开(O)】。4.执行完3步后请点击【选择】按钮,并在下面的文件信息中,将【创建时间】【修改时间】【访问时间】修改为您需要的数值后,点击修改。5.在提示修改中选择【是(Y)】,不修改选择【否(N)】。6.完成以上步骤后即修改好一个文件,如果需要修改其他文件,请继续重复2-5步。
recommend-type

ISO 6469-3-2021 电动道路车辆 - 安全规范 - 第 3 部分:电气安全.docx

国际标准,txt格式 本文件规定了电力推进系统电压 B 级电路和电动道路车辆导电连接辅助电力系统的电气安全要求。 它规定了保护人员免受电击和热事故的电气安全要求。 它没有为制造、维护和维修人员提供全面的安全信息。 注 1: 碰撞后的电气安全要求在 ISO 6469-4 中有描述。 注 2:ISO 17409 描述了电动道路车辆与外部电源的导电连接的电气安全要求。 注 3: 外部磁场无线功率传输的特殊电气安全要求 在 ISO 19363 中描述了电力供应和电动车辆。 注 4 摩托车和轻便摩托车的电气安全要求在 ISO 13063 系列中有描述。 2 引用标准 以下文件在文中的引用方式是,其部分或全部内容构成本文件的要求。对于注明日期的参考文献,只有引用的版本适用。对于未注明日期的引用,引用文件的最新版本 (包括任何修订) 适用。 ISO 17409: 电动道路车辆。导电动力传输。安全要求 ISO 20653,道路车辆 - 保护程度 (IP 代码)- 电气设备防异物、水和接触的保护 IEC 60664 (所有部件) 低压系统内设备的绝缘配合 IEC 60990:2016,接触电流和保护导体

最新推荐

recommend-type

Python100-master (3)

Python100-master (3)
recommend-type

Netty服务端启动流程源码分析.zip

Netty服务端启动流程源码分析.zip
recommend-type

MyBatis(1)Mybaits框架的由来和工作原理.zip

MyBatis(1)Mybaits框架的由来和工作原理.zip
recommend-type

20如何成为真正的ppt高手(网络传播版)说课材料.ppt

20如何成为真正的ppt高手(网络传播版)说课材料.ppt
recommend-type

Visio实用教程:绘制流程图与组织结构

Microsoft Office Visio 是一款由微软公司出品的绘图软件,广泛应用于办公自动化领域,其主要功能是制作流程图、组织结构图、网络拓扑图、平面布局图、软件和数据库架构图等。Visio 使用教程通常包含以下几个方面的知识点: 1. Visio 基础操作 Visio 的基础操作包括软件界面布局、打开和保存文件、创建新文档、模板选择、绘图工具的使用等。用户需要了解如何通过界面元素如标题栏、菜单栏、工具栏、绘图页面和状态栏等进行基本的操作。 2. 分析业务流程 Visio 可以通过制作流程图帮助用户分析和优化业务流程。这包括理解流程图的构成元素,如开始/结束符号、处理步骤、决策点、数据流以及如何将它们组合起来表示实际的业务流程。此外,还要学习如何将业务流程的每个步骤、决策点以及相关负责人等内容在图表中清晰展示。 3. 安排项目日程 利用 Visio 中的甘特图等项目管理工具,可以为项目安排详细的日程表。用户需要掌握如何在 Visio 中创建项目时间轴,设置任务节点、任务持续时间以及它们之间的依赖关系,从而清晰地规划项目进程。 4. 形象地表达思维过程 通过 Visio 的绘图功能,用户可以将复杂的思维过程和概念通过图形化的方式表达出来。这涉及理解各种图表和图形元素,如流程图、组织结构图、思维导图等,并学习如何将它们组织起来,以更加直观地展示思维逻辑和概念结构。 5. 绘制组织结构图 Visio 能够帮助用户创建和维护组织结构图,以直观展现组织架构和人员关系。用户需掌握如何利用内置的组织结构图模板和相关的图形组件,以及如何将部门、职位、员工姓名等信息在图表中体现。 6. 网络基础设施及平面布置图 Visio 提供了丰富的符号库来绘制网络拓扑图和基础设施平面布置图。用户需学习如何使用这些符号表示网络设备、服务器、工作站、网络连接以及它们之间的物理或逻辑关系。 7. 公共设施设备的表示 在建筑工程、物业管理等领域,Visio 也可以用于展示公共设施布局和设备的分布,例如电梯、楼梯、空调系统、水暖系统等。用户应学习如何利用相关的图形和符号准确地绘制出这些设施设备的平面图或示意图。 8. 电路图和数据库结构 对于工程师和技术人员来说,Visio 还可以用于绘制电路图和数据库结构图。用户需要了解如何利用 Visio 中的电气工程和数据库模型符号库,绘制出准确且专业的电气连接图和数据库架构图。 9. Visio 版本特定知识 本教程中提到的“2003”指的是 Visio 的一个特定版本,用户可能需要掌握该版本特有的功能和操作方式。随着时间的推移,虽然 Visio 的核心功能基本保持一致,但每次新版本发布都会增加一些新特性或改进用户界面,因此用户可能还需要关注学习如何使用新版本的新增功能。 为了帮助用户更好地掌握上述知识点,本教程可能还包括了以下内容: - Visio 各版本的新旧功能对比和改进点。 - 高级技巧,例如自定义模板、样式、快捷键使用等。 - 示例和案例分析,通过实际的项目案例来加深理解和实践。 - 常见问题解答和故障排除技巧。 教程可能以 VISIODOC.CHM 命名的压缩包子文件存在,这是一个标准的 Windows 帮助文件格式。用户可以通过阅读该文件学习 Visio 的使用方法,其中可能包含操作步骤的截图、详细的文字说明以及相关的操作视频。该格式文件易于索引和搜索,方便用户快速定位所需内容。
recommend-type

【性能测试基准】:为RK3588选择合适的NVMe性能测试工具指南

# 1. NVMe性能测试基础 ## 1.1 NVMe协议简介 NVMe,全称为Non-Volatile Memory Express,是专为固态驱动器设计的逻辑设备接口规范。与传统的SATA接口相比,NVMe通过使用PCI Express(PCIe)总线,大大提高了存储设备的数据吞吐量和IOPS(每秒输入输出操作次数),特别适合于高速的固态存储设备。
recommend-type

AS开发一个 App,用户在界面上提交个人信息后完成注册,注册信息存入数 据库;用户可以在界面上输入查询条件,查询数据库中满足给定条件的所有数 据记录。这些数据记录应能够完整地显示在界面上(或支持滚动查看),如果 查询不到满足条件的记录,则在界面上返回一个通知。

### 实现用户注册与信息存储 为了创建一个能够处理用户注册并将信息存入数据库的应用程序,可以采用SQLite作为本地数据库解决方案。SQLite是一个轻量级的关系型数据库管理系统,在Android平台上广泛用于管理结构化数据[^4]。 #### 创建项目和设置环境 启动Android Studio之后新建一个项目,选择“Empty Activity”。完成基本配置后打开`build.gradle(Module)`文件加入必要的依赖项: ```gradle dependencies { implementation 'androidx.appcompat:appcompat:1
recommend-type

VC++图像处理算法大全

在探讨VC++源代码及其对应图像处理基本功能时,我们首先需要了解图像处理的基本概念,以及VC++(Visual C++)在图像处理中的应用。然后,我们会对所列的具体图像处理技术进行详细解读。 ### 图像处理基础概念 图像处理是指对图像进行采集、分析、增强、恢复、识别等一系列的操作,以便获取所需信息或者改善图像质量的过程。图像处理广泛应用于计算机视觉、图形学、医疗成像、遥感技术等领域。 ### VC++在图像处理中的应用 VC++是一种广泛使用的C++开发环境,它提供了强大的库支持和丰富的接口,可以用来开发高性能的图像处理程序。通过使用VC++,开发者可以编写出利用Windows API或者第三方图像处理库的代码,实现各种图像处理算法。 ### 图像处理功能详细知识点 1. **256色转灰度图**:将256色(即8位)的颜色图像转换为灰度图像,这通常通过加权法将RGB值转换成灰度值来实现。 2. **Hough变换**:主要用于检测图像中的直线或曲线,尤其在处理边缘检测后的图像时非常有效。它将图像空间的点映射到参数空间的曲线上,并在参数空间中寻找峰值来识别图像中的直线或圆。 3. **Walsh变换**:属于正交变换的一种,用于图像处理中的快速计算和信号分析。它与傅立叶变换有相似的特性,但在计算上更为高效。 4. **对比度拉伸**:是一种增强图像对比度的方法,通常用于增强暗区或亮区细节,提高整体视觉效果。 5. **二值化变换**:将图像转换为只包含黑和白两种颜色的图像,常用于文字识别、图像分割等。 6. **反色**:也称作颜色反转,即图像的每个像素点的RGB值取反,使得亮部变暗,暗部变亮,用于强调图像细节。 7. **方块编码**:一种基于图像块处理的技术,可以用于图像压缩、分类等。 8. **傅立叶变换**:广泛用于图像处理中频域的分析和滤波,它将图像从空间域转换到频域。 9. **高斯平滑**:用高斯函数对图像进行滤波,常用于图像的平滑处理,去除噪声。 10. **灰度均衡**:通过调整图像的灰度级分布,使得图像具有均衡的亮度,改善视觉效果。 11. **均值滤波**:一种简单的平滑滤波器,通过取邻域像素的平均值进行滤波,用来降低图像噪声。 12. **拉普拉斯锐化**:通过增加图像中的高频分量来增强边缘,提升图像的锐利度。 13. **离散余弦变换**(DCT):类似于傅立叶变换,但在图像压缩中应用更为广泛,是JPEG图像压缩的核心技术之一。 14. **亮度增减**:调整图像的亮度,使其变亮或变暗。 15. **逆滤波处理**:用于图像复原的一种方法,其目的是尝试恢复受模糊影响的图像。 16. **取对数**:用于图像显示或特征提取时的一种非线性变换,可将大范围的灰度级压缩到小范围内。 17. **取指数**:与取对数相反,常用于改善图像对比度。 18. **梯度锐化**:通过计算图像的梯度来增强边缘,使图像更清晰。 19. **图像镜像**:将图像左右或者上下翻转,是一种简单的图像变换。 20. **图像平移**:在图像平面内移动图像,以改变图像中物体的位置。 21. **图像缩放**:改变图像大小,包括放大和缩小。 22. **图像细化**:将图像的前景(通常是文字或线条)变细,以便于识别或存储。 23. **图像旋转**:将图像绕某一点旋转,可用于图像调整方向。 24. **维纳滤波处理**:一种最小均方误差的线性滤波器,常用于图像去噪。 25. **Canny算子提取边缘**:利用Canny算子检测图像中的边缘,是边缘检测中较为精确的方法。 26. **阈值变换**:通过设定一个或多个阈值,将图像转换为二值图像。 27. **直方图均衡**:通过拉伸图像的直方图来增强图像的对比度,是一种常用的图像增强方法。 28. **中值滤波**:用邻域像素的中值替换当前像素值,用于去除椒盐噪声等。 ### 总结 通过上述的知识点介绍,我们已经了解了VC++源代码在实现多种图像处理功能方面的重要性和实践。这些技术是图像处理领域的基础,对于图像处理的初学者和专业人士都具有重要的意义。在实际应用中,根据具体的需求选择合适的技术是至关重要的。无论是进行图像分析、增强还是压缩,这些技术和算法都是支撑实现功能的关键。通过VC++这样的编程环境,我们能够把这些技术应用到实践中,开发出高效、可靠的图像处理软件。
recommend-type

【固态硬盘寿命延长】:RK3588平台NVMe维护技巧大公开

# 1. 固态硬盘寿命延长的基础知识 ## 1.1 固态硬盘的基本概念 固态硬盘(SSD)是现代计算设备中不可或缺的存储设备之一。与传统的机械硬盘(HDD)相比,SSD拥有更快的读写速度、更小的体积和更低的功耗。但是,SSD也有其生命周期限制,主要受限于NAND闪存的写入次数。 ## 1.2 SSD的写入次数和寿命 每块SSD中的NAND闪存单元都有有限的写入次数。这意味着,随着时间的推移,SSD的
recommend-type

GDIplus创建pen

### 如何在GDI+中创建和使用Pen对象 在 GDI+ 中,`Pen` 类用于定义线条的颜色、宽度和其他样式。要创建 `Pen` 对象并设置其属性,可以按照如下方式进行: #### 创建基本 Pen 对象 最简单的方式是通过指定颜色来实例化一个新的 `Pen` 对象。 ```csharp using System.Drawing; // 使用纯色创建一个简单的黑色画笔 Pen blackPen = new Pen(Color.Black); ``` #### 设置线宽 可以通过传递第二个参数给构造函数来设定线条的粗细程度。 ```csharp // 定义一条宽度为3像素的红色线