首页 > 其他分享 >绘制PR曲线

绘制PR曲线

时间:2023-05-28 20:00:34浏览次数:35  
标签:PR plot val glob 曲线 results ax txt 绘制

 

def plot_results_overlay(start=0, stop=0):  # from utils.plots import *; plot_results_overlay()
    # Plot training 'results*.txt', overlaying train and val losses
    s = ['train', 'train', 'train', 'Precision', '[email protected]', 'val', 'val', 'val', 'Recall', '[email protected]:0.95']  # legends
    t = ['Box', 'Objectness', 'Classification', 'P-R', 'mAP-F1']  # titles
    for f in sorted(glob.glob('results*.txt') + glob.glob('../../Downloads/results*.txt')):
        results = np.loadtxt(f, usecols=[2, 3, 4, 8, 9, 12, 13, 14, 10, 11], ndmin=2).T
        n = results.shape[1]  # number of rows
        x = range(start, min(stop, n) if stop else n)
        fig, ax = plt.subplots(1, 5, figsize=(14, 3.5), tight_layout=True)
        ax = ax.ravel()
        for i in range(5):
            for j in [i, i + 5]:
                y = results[j, x]
                ax[i].plot(x, y, marker='.', label=s[j])
                # y_smooth = butter_lowpass_filtfilt(y)
                # ax[i].plot(x, np.gradient(y_smooth), marker='.', label=s[j])

            ax[i].set_title(t[i])
            ax[i].legend()
            ax[i].set_ylabel(f) if i == 0 else None  # add filename
        fig.savefig(f.replace('.txt', '.png'), dpi=200)

 

代码参考 yolov5

##############

标签:PR,plot,val,glob,曲线,results,ax,txt,绘制
From: https://www.cnblogs.com/herd/p/17438745.html

相关文章

  • springboot整合mybatis实现简单的crud操作
    使用MyBatis框架操作数据,在SpringBoot框架集成MyBatis,项目整体结构前提:准备一张student表。SETNAMESutf8mb4;SETFOREIGN_KEY_CHECKS=0;--------------------------------Tablestructureforuser------------------------------DROPTABLEIFEXISTS`student`......
  • QT 绘制波形图、频谱图、瀑布图、星座图、眼图、语图
    说明最近在学中频信号处理的一些东西,顺便用QT写了一个小工具,可以显示信号的时域波形图、幅度谱、功率谱、二次方谱、四次方谱、八次方谱、瞬时包络、瞬时频率、瞬时相位、非线性瞬时相位、瞬时幅度直方图、瞬时频率直方图、瞬时相位直方图、眼图、星座图、语谱图、瀑布图。1.实......
  • QT 绘制波形图、频谱图、瀑布图、星座图、眼图、语图
    说明最近在学中频信号处理的一些东西,顺便用QT写了一个小工具,可以显示信号的时域波形图、幅度谱、功率谱、二次方谱、四次方谱、八次方谱、瞬时包络、瞬时频率、瞬时相位、非线性瞬时相位、瞬时幅度直方图、瞬时频率直方图、瞬时相位直方图、眼图、星座图、语谱图、瀑布图。目......
  • springboot配置Swagger3.0
    springboot配置Swagger3.01、pom加入依赖我们创建一个SpringBoot项目,引入swagger3依赖<dependency><groupId>io.springfox</groupId><artifactId>springfox-boot-starter</artifactId><version>3.0.0</version></dependency&......
  • 应用启动时加载application.properties配置文件
    配置aliyun.sms.regionId=defaultaliyun.sms.accessKeyId=LTAIxxxaliyun.sms.secret=PAxxxx importorg.springframework.beans.factory.InitializingBean;importorg.springframework.beans.factory.annotation.Value;importorg.springframework.stereotype.Compone......
  • Unity的IPostGenerateGradleAndroidProject:深入解析与实用案例
    UnityIPostGenerateGradleAndroidProjectUnity是一款流行的跨平台游戏引擎,它支持多种平台,包括Android。在Unity中,我们可以使用IPostGenerateGradleAndroidProject接口来自定义Gradle构建过程。本文将介绍如何使用IPostGenerateGradleAndroidProject接口,并提供三个使用例子。IPos......
  • Spring Cloud Alibaba Sentinel实现熔断限流代码示例
    SpringCloudAlibabaSentinel介绍SpringCloudAlibabaSentinel是一个面向分布式服务架构的流量控制组件,是SpringCloudAlibaba的核心组件之一。主要以流量为切入点,从流量控制、熔断降级、系统自适应保护等多个维度来帮助您保障微服务的稳定性。代码示例以下是一个使用SpringC......
  • Java:SpringBoot整合Canal+RabbitMQ组合实现MySQL数据监听
    canal[kə’næl],译意为水道/管道/沟渠,主要用途是基于MySQL数据库增量日志解析,提供增量数据订阅和消费目录一、MySQL设置二、启动Canal服务端三、通过Canal客户端消费数据四、通过RabbitMQ消费数据1、启动RabbitMQ2、修改canal配置3、消费RabbitMQ中的数据文档资料github:https......
  • SpringBoot项目启动失败报错Annotation-specified bean name ‘xx‘ for bean class [
    Annotation-specifiedbeanname'datahubServiceImpl'forbeanclass[com.peony.common.service.impl.DatahubServiceImpl]conflictswithexisting,non-compatiblebeandefinitionofsamenameandclass[com.peony.common.service.DatahubServiceImpl] 1、......
  • [论文速览] MAGE@MAsked Generative Encoder to Unify Representation Learning and I
    Pretitle:MAGE:MAskedGenerativeEncodertoUnifyRepresentationLearningandImageSynthesisaccepted:CVPR2023paper:https://arxiv.org/abs/2211.09117code:https://github.com/LTH14/mageref:https://mp.weixin.qq.com/s/AfWWwrEpYAHI03tIzVxMiQ关键词:Repre......