3 篇文章带有标签 “validation”

FastAPI : Request File and Form(BaseModel)

两种方法

(file: UploadFile = File(...), mask: Json = Form(default=None))

from pydantic import BaseModel, Json, ValidationError
from fastapi import APIRouter, File, UploadFile, HTTPException, Form, Depends

class Box(BaseModel):
    x: int
    y: int
    w: int
    h: int

router = APIRouter()

@router.post("/test")
async def test(file: UploadFile = File(...), 
               mask: Json = Form(default=None), 
               n: int = Form(default=0)) -> str:
// ...

(file: UploadFile = File(...), mask: Box = Depends(validate_json(Box)))

OpenVINO Cross Check Tool

交叉检查工具 (Cross Check Tool)

可以比较两个连续模型推理的准确性和性能指标,这些推理在两个不同的受支持的英特尔设备上执行或以不同的精度执行。交叉检查工具可以比较每层或整个模型的指标。

查看帮助信息 $ python cross_check_tool.py -h usage: -------------------------------------------------------------- For cross precision check provide two IRs (mapping files may be needed) run: python3 cross_check_tool.py \ --input path/to/file/describing/input \ --model path/to/model/.xml \ --device device_for_model \ --reference_model path/to/reference_model/.

Deep Learning Accuracy Validation Framework

深度学习准确性验证框架

例子

进入 accuracy_checker 目录

cd open_model_zoo/tools/accuracy_checker

下载数据集

wget https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz
tar xvf cifar-10-python.tar.gz -C sample

配置文件结构

models:
  - name: model_name

    launchers:
      - framework: openvino
        adapter: adapter_name

    datasets:
      - name: dataset_name

评估 accuracy_check -c sample/sample_config.yml -m data/test_models/ -s sample/ 2022-05-18 11:18:38.663810: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library libcudart.so.11.