KPAC(ICCV 2021)代码单图片推理

文章目录

  • KPAC(ICCV 2021)代码单图片推理
    • 创建虚拟环境
    • 安装依赖包
    • 数据集路径设置
    • 运行测试
      • 单图片推理

KPAC(ICCV 2021)代码单图片推理

论文链接:Single Image Defocus Deblurring Using Kernel-Sharing Parallel Atrous Convolutions

该论文研究的问题是散焦去模糊,是图像恢复中经常需要做的一个任务,经常需要找对比图片。如果可以运行该论文,那么论文中可以增加一个对比图片。现在论文中大家都不用TensorFlow,不巧的是该论文原始代码是TF写的。我们并不是改为torch形式,而依然通过安装tf1.15的gpu版本。原始的代码我没法进行测试,改了半天放弃了,结合chatgpt写了一个单图片推理的代码,可以成功运行,但是依然需要大概8.6G的显存

我的环境:

系统:Ubuntu 22.04(WSL2)
显卡:4070 ti s
wsl2的cuda版本:11.5

论文github链接:https://github.com/HyeongseokSon1/KPAC

TensorFlow的版本:https://developer.download.nvidia.com/compute/redist/nvidia-tensorflow/

我使用的tf版本下载:https://developer.download.nvidia.com/compute/redist/nvidia-tensorflow/nvidia_tensorflow-1.15.5+nv21.11-cp38-cp38-linux_x86_64.whl

该tf1.15.5版本应该是支持30和40系显卡的。

论文的KPAC如下:

在这里插入图片描述

创建虚拟环境

通过conda新建虚拟环境,使用如下代码:

conda create -n KPAC python=3.8

激活环境:

conda activate KPAC

再KPAC虚拟环境下安装依赖包,切忌不要再base虚拟环境下操作,通过新建虚拟环境来操作。

安装依赖包

首先下载下来nvidia_tensorflow-1.15.5+nv21.11-cp38-cp38-linux_x86_64.whl,然后本地安装:

pip install nvidia_tensorflow-1.15.5+nv21.11-cp38-cp38-linux_x86_64.whl

安装tf之后,测试gpu是否可用。将下面代码保存为device_gpu.py,然后运行。

import tensorflow as tf

gpus = tf.config.experimental.list_physical_devices('GPU')
if gpus:
    print("Available GPU(s):")
    for gpu in gpus:
        print(gpu)
else:
    print("No GPUs detected.")

输出大概如下:

2024-11-25 11:09:56.018231: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.
2024-11-25 11:09:57.076884: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcuda.so.1
2024-11-25 11:09:57.303655: E tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1068] could not open file to read NUMA node: /sys/bus/pci/devices/0000:2b:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-11-25 11:09:57.303730: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1666] Found device 0 with properties: 
name: NVIDIA GeForce RTX 4070 Ti SUPER major: 8 minor: 9 memoryClockRate(GHz): 2.61
pciBusID: 0000:2b:00.0
2024-11-25 11:09:57.303762: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
2024-11-25 11:09:57.330370: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11
2024-11-25 11:09:57.354441: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcufft.so.10
2024-11-25 11:09:57.357430: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcurand.so.10
2024-11-25 11:09:57.363308: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusolver.so.11
2024-11-25 11:09:57.382721: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcusparse.so.11
2024-11-25 11:09:57.383752: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8
2024-11-25 11:09:57.383854: E tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1068] could not open file to read NUMA node: /sys/bus/pci/devices/0000:2b:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-11-25 11:09:57.383936: E tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:1068] could not open file to read NUMA node: /sys/bus/pci/devices/0000:2b:00.0/numa_node
Your kernel may have been built without NUMA support.
2024-11-25 11:09:57.383970: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1794] Adding visible gpu devices: 0
Available GPU(s):
PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')

会有一个GPU:0,表示gpu可用。

之后可以安装下面依赖包:

easydict==1.13
matplotlib==3.5.3
numpy==1.18.5
opencv-python==4.10.0.84
protobuf==3.20.3
scikit-image==0.17.2
scipy==1.7.3

数据集路径设置

找到根目录下的config.py文件,修改如下路径:

# for dual
config.TEST.folder_path_c = 'DeblurDataset/DefocusDeblur/test_c/' # need to change
config.TEST.folder_path_l = 'DeblurDataset/DefocusDeblur/test_l/' # need to change
config.TEST.folder_path_r = 'DeblurDataset/DefocusDeblur/test_r/' # need to change

因为我是运行的双像素去看模糊,根据main_eval_dual.py修改的,我就只修改了这个路径。

运行测试

如果安装原论文的方法使用如下代码测试:

CUDA_VISIBLE_DEVICES=0 python main_eval_dual.py

会有如下错误,我是放弃了修改这个代码,scipy=1.2.*的版本好像在python 3.8版本中不可安装。

[*] Load pretrained/dual.npz SUCCESS!
Exception in thread threading_and_return:
Traceback (most recent call last):
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/tensorlayer/prepro.py", line 99, in apply_fn
    results[i] = fn(data, **kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/utils.py", line 26, in get_imgs_fn
    return scipy.misc.imread(path + file_name, mode='RGB')
AttributeError: module 'scipy.misc' has no attribute 'imread'
read 1 from DeblurDataset/DefocusDeblur/test_c//source/
Exception in thread threading_and_return:
Traceback (most recent call last):
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/tensorlayer/prepro.py", line 99, in apply_fn
    results[i] = fn(data, **kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/utils.py", line 26, in get_imgs_fn
    return scipy.misc.imread(path + file_name, mode='RGB')
AttributeError: module 'scipy.misc' has no attribute 'imread'
read 1 from DeblurDataset/DefocusDeblur/test_l//source/
Exception in thread threading_and_return:
Traceback (most recent call last):
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/tensorlayer/prepro.py", line 99, in apply_fn
    results[i] = fn(data, **kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/utils.py", line 26, in get_imgs_fn
    return scipy.misc.imread(path + file_name, mode='RGB')
AttributeError: module 'scipy.misc' has no attribute 'imread'
read 1 from DeblurDataset/DefocusDeblur/test_r//source/
[!] ./Evaluations/dual_results/ exists ...
Exception in thread threading_and_return:
Traceback (most recent call last):
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/tensorlayer/prepro.py", line 99, in apply_fn
    results[i] = fn(data, **kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/utils.py", line 53, in scale_imgs_fn
    x = x-127.5
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
Exception in thread threading_and_return:
Traceback (most recent call last):
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/tensorlayer/prepro.py", line 99, in apply_fn
    results[i] = fn(data, **kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/utils.py", line 53, in scale_imgs_fn
    x = x-127.5
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
Exception in thread threading_and_return:
Traceback (most recent call last):
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/tensorlayer/prepro.py", line 99, in apply_fn
    results[i] = fn(data, **kwargs)
  File "/mnt/e/research/SOTA_Restoration/KPAC/utils.py", line 53, in scale_imgs_fn
    x = x-127.5
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
Traceback (most recent call last):
  File "main_eval_dual.py", line 109, in <module>
    DefocusDeblur()
  File "main_eval_dual.py", line 93, in DefocusDeblur
    out = sess.run(result, {t_image_c: valid_ref_img_c, t_image_l: valid_ref_img_l,t_image_r: valid_ref_img_r})                
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/site-packages/tensorflow_core/python/client/session.py", line 955, in run
    result = self._run(None, fetches, feed_dict, options_ptr,
  File "/home/wang/miniconda3/envs/KPAC/lib/python3.8/site-packages/tensorflow_core/python/client/session.py", line 1153, in _run
    raise ValueError(
ValueError: Cannot feed value of shape (1,) for Tensor 't_image_c:0', which has shape '(1, 1120, 1680, 3)'

虽说默认的代码无法运行,我们主要为了测试,生成一个去模糊的图片,我们也不是用于训练的,非常不推荐运行。

如果你想复现图像恢复相关的论文,我推荐你NAFNet、Restormer,这两个效果又好,又容易,缺点就是需要显卡,如果你想使用自己的数据集,修改修改batch_size,调小一点。

单图片推理

回到KPAC,默认的代码无法使用,我们修改一下,改为单图片去模糊,使用如下代码,可以随便起一个文件名,例如single_img.py。

import os
import time
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from model import Defocus_Deblur_Net6_ds_dual
from utils import scale_imgs_fn
from PIL import Image


# 加载并预处理图片
def load_and_preprocess_image(img_path):
    """
    加载并预处理图片。
    :param img_path: 图片路径
    :return: 归一化后的图片数组
    """
    if not os.path.exists(img_path):
        raise FileNotFoundError(f"[Error] Image not found: {img_path}")
    
    img = Image.open(img_path).convert("RGB")  # 确保图片为 RGB 格式
    img = np.array(img, dtype=np.float32)
    img = np.expand_dims(img, axis=0)  # 添加 batch 维度
    img = tl.prepro.threading_data(img, fn=scale_imgs_fn)  # 归一化到 [-1, 1]
    return img


# 保存图片
def save_image(image_array, save_path):
    """
    保存图片到文件。
    :param image_array: 图像数组 ([-1, 1])
    :param save_path: 保存路径
    """
    # 将 [-1, 1] 转换为 [0, 255]
    image_array = ((image_array + 1) * 127.5).astype(np.uint8)
    image = Image.fromarray(image_array)
    image.save(save_path)
    print(f"Deblurred image saved to {save_path}")


# 测试单张图片的去模糊
def test_single_image(image_path_c, image_path_l, image_path_r, save_path):
    """
    测试单张图片的去模糊。
    :param image_path_c: 中心图像路径
    :param image_path_l: 左图像路径
    :param image_path_r: 右图像路径
    :param save_path: 输出结果保存路径
    """
    # 参数定义
    H, W = 1120, 1680
    checkpoint_dir = "pretrained"

    # 加载图片
    try:
        img_c = load_and_preprocess_image(image_path_c)
        img_l = load_and_preprocess_image(image_path_l)
        img_r = load_and_preprocess_image(image_path_r)
    except FileNotFoundError as e:
        print(e)
        return

    # 构建网络
    with tf.device('/device:GPU:0'):
        t_image_c = tf.placeholder('float32', [1, H, W, 3], name='t_image_c')
        t_image_l = tf.placeholder('float32', [1, H, W, 3], name='t_image_l')
        t_image_r = tf.placeholder('float32', [1, H, W, 3], name='t_image_r')
        net_g = Defocus_Deblur_Net6_ds_dual(t_image_c, t_image_l, t_image_r, is_train=False, hrg=H, wrg=W)
        result = net_g.outputs

    # TensorFlow 会话配置
    configg = tf.ConfigProto()
    configg.gpu_options.allow_growth = True
    sess = tf.Session(config=configg)
    tl.layers.initialize_global_variables(sess)
    tl.files.load_and_assign_npz(sess=sess, name=f'{checkpoint_dir}/dual.npz', network=net_g)

    # 运行模型
    print("[*] Running deblurring...")
    start_time = time.time()
    out = sess.run(result, feed_dict={t_image_c: img_c, t_image_l: img_l, t_image_r: img_r})
    print("Processing time: %.4fs" % (time.time() - start_time))

    # 保存结果
    save_image(out[0], save_path)


# 主函数
if __name__ == '__main__':
    # 测试单张图片的输入路径
    image_path_c = "DeblurDataset/DefocusDeblur/test_c/source/1P0A2417.png"  # 替换为实际图片路径
    image_path_l = "DeblurDataset/DefocusDeblur/test_l/source/1P0A2417_L.png"    # 替换为实际图片路径
    image_path_r = "DeblurDataset/DefocusDeblur/test_r/source/1P0A2417_R.png"   # 替换为实际图片路径

    # 保存结果的路径
    save_path = "./deblurred_result.png"

    # 调用测试函数
    test_single_image(image_path_c, image_path_l, image_path_r, save_path)

之后我们运行该代码:

python single_img.py

大概输出如下内容:

[*] Load pretrained/dual.npz SUCCESS!
[*] Running deblurring...
2024-11-25 11:43:55.798790: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudnn.so.8
2024-11-25 11:43:58.611393: W tensorflow/stream_executor/cuda/redzone_allocator.cc:312] Internal: ptxas exited with non-zero error code 65280, output: ptxas fatal   : Value 'sm_89' is not defined for option 'gpu-name'

Relying on driver to perform ptx compilation. This message will be only logged once.
2024-11-25 11:43:59.507653: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcublas.so.11
Processing time: 33.1819s
Deblurred image saved to ./deblurred_result.png

可以成功使用gpu预测,但是不巧的是,需要显存大概8.6G,所以最好使用12G显存以上的显卡,否则可能无法使用gpu预测,或者直接使用cpu预测。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/923605.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Flink cdc同步增量数据timestamp字段相差八小时(分析|解决)不是粘贴复制的!

问题 我使用flink cdc同步mysql到mysql遇到了timestamp字段缺少八小时的问题。很少无语&#xff0c;flink ,cdc,debezium时区都设置了&#xff0c;没有任何效果&#xff01; 分析 问题出现在mysql binlog身上&#xff01;&#xff01;&#xff01; 因为默认mysql会使用UTC来…

算法新篇章:AI如何在数学领域超越人类

人工智能咨询培训老师叶梓 转载标明出处 尽管大模型在很多领域表现出色&#xff0c;比如理解自然语言和生成文本&#xff0c;但它们在解决一些复杂的推理任务时&#xff0c;比如数学问题、编程挑战或者医疗诊断&#xff0c;还是显得有些力不从心。最近&#xff0c;一个来自中国…

MTK主板_安卓主板方案_MTK联发科主板定制开发

联发科(MTK)主板以其强大的性能和多样化的功能而受到广泛关注。该平台包括多个型号&#xff0c;例如MT6761、MT8766、MT6762、MT6765、MT8768和MT8788等&#xff0c;均配置了四核或八核64位处理器&#xff0c;主频可高达2.0GHz。采用先进的12nm工艺&#xff0c;搭载Android 11.…

windows安全中心,永久卸载工具分享

使用方法 2024Goby红队版工具分享&#xff0c;附2024年漏洞POC下载 下载链接&#xff1a; https://pan.quark.cn/s/4fc2712a2afc一路回车&#xff0c;选项Y即可 耐心等待几秒种&#xff0c;自动重启 此时打开windows安全中心&#xff0c;已经完全不能使用了&#xff0c;响应…

css—轮播图实现

一、背景 最近和朋友在一起讨论的时候&#xff0c;我们提出了这样的一个提问&#xff0c;难道轮播图的效果只能通过js来实现吗&#xff1f;经过我们的一系列的争论&#xff0c;发现了这是可以通过纯css来实现这一效果的&#xff0c;CSS轮播图也是一种常见的网页展示方式&#x…

使用Python和Pybind11调用C++程序(CMake编译)

目录 一、前言二、安装 pybind11三、编写C示例代码四、结合Pybind11和CMake编译C工程五、Python调用动态库六、参考 一、前言 跨语言调用能对不同计算机语言进行互补&#xff0c;本博客主要介绍如何实现Python调用C语言编写的函数。 实验环境&#xff1a; Linux gnuPython3.10…

设计模式之 责任链模式

责任链模式&#xff08;Chain of Responsibility Pattern&#xff09;是一种行为型设计模式&#xff0c;旨在将多个处理对象通过链式结构连接起来&#xff0c;形成一条处理请求的链条。每个处理对象都有机会处理请求&#xff0c;或者将请求传递给链中的下一个对象。这样&#x…

EXTI配置流程 含中断延时消抖点亮小灯

如图可知&#xff0c;配置流程分成以下一个部分 ①使能GPIO时钟 __HAL_RCC_GPIOA_CLK_ENABLE();// 打开时钟 ②初始化利用 HAL_GPIO_Init 一步到位&#xff0c;可以初始化外设GPIO的一切 4个参数 &#xff08;引脚 Pull 这里选择的模式是从下面这几个里面选 速度&#x…

Scrapy图解工作流程-cnblog

1.1 介绍部分&#xff1a; 文字提到常用的Web框架有Django和Flask&#xff0c;接下来将学习一个全球范围内流行的爬虫框架Scrapy。 1.2 内容部分&#xff1a; Scrapy的概念、作用和工作流程 Scrapy的入门使用 Scrapy构造并发送请求 Scrapy模拟登陆 Scrapy管道的使用 Scrapy中…

string类部分(C++)

目录 1. string类 1.1 auto和范围for auto关键词&#xff1a; 范围for&#xff1a; 1.2 string类的常用接口说明 a&#xff09;string类对象的常见构造 b&#xff09; string类对象的容量操作 size与length&#xff1a; capacity: empty: clear: reserve: 1.reserve&am…

实现一个可配置的TCP设备模拟器,支持交互和解析配置

前言 诸位在做IOT开发的时候是否有遇到一个问题&#xff0c;那就是模拟一个设备来联调测试&#xff0c;虽然说现在的物联网通信主要是用mqtt通信&#xff0c;但还是有很多设备使用TCP这种协议交互&#xff0c;例如充电桩&#xff0c;还有一些工业设备&#xff0c;TCP这类报文交…

Redis主从架构

Redis&#xff08;Remote Dictionary Server&#xff09;是一个开源的、高性能的键值对存储系统&#xff0c;广泛应用于缓存、消息队列、实时分析等场景。为了提高系统的可用性、可靠性和读写性能&#xff0c;Redis提供了主从复制&#xff08;Master-Slave Replication&#xf…

Java项目实战II基于微信小程序的校运会管理系统(开发文档+数据库+源码)

目录 一、前言 二、技术介绍 三、系统实现 四、核心代码 五、源码获取 全栈码农以及毕业设计实战开发&#xff0c;CSDN平台Java领域新星创作者&#xff0c;专注于大学生项目实战开发、讲解和毕业答疑辅导 一、前言 在充满活力与激情的校园生活中&#xff0c;校运会不仅是…

软件团队的共担责任

问责制被认为是个人与其社会系统之间的纽带&#xff0c;它创造了一种将个人与其行为和绩效联系起来的身份关系。在入门系列的第一篇文章《超越工具和流程&#xff1a;成功软件开发团队的策略》中&#xff0c;我们介绍了问责制的概念&#xff0c;并提出了以下定义&#xff1a; …

学习日记_20241126_聚类方法(谱聚类Spectral Clustering)

前言 提醒&#xff1a; 文章内容为方便作者自己后日复习与查阅而进行的书写与发布&#xff0c;其中引用内容都会使用链接表明出处&#xff08;如有侵权问题&#xff0c;请及时联系&#xff09;。 其中内容多为一次书写&#xff0c;缺少检查与订正&#xff0c;如有问题或其他拓展…

如何使用Jest测试你的React组件

在本文中&#xff0c;我们将了解如何使用Jest&#xff08;Facebook 维护的一个测试框架&#xff09;来测试我们的React组件。我们将首先了解如何在纯 JavaScript 函数上使用 Jest&#xff0c;然后再了解它提供的一些开箱即用的功能&#xff0c;这些功能专门用于使测试 React 应…

硬菜!高精度!BO-Transformer贝叶斯优化编码器多特征分类预测/故障诊断

硬菜&#xff01;高精度&#xff01;BO-Transformer贝叶斯优化编码器多特征分类预测/故障诊断 目录 硬菜&#xff01;高精度&#xff01;BO-Transformer贝叶斯优化编码器多特征分类预测/故障诊断效果一览基本介绍程序设计参考资料 效果一览 基本介绍 1.Matlab实现BO-Transform…

仿真学习 | Abaqus版本差异详解:哪版更适合你的仿真作业?

​ 引言 在上一篇文章《仿真学习 | Fluent版本迭代一览及选择指南》中&#xff0c;我们深入探讨了Fluent的不同版本以及如何根据自身需求选择最合适的版本。今天&#xff0c;我们将把视线聚焦于Abaqus——另一款在工程仿真领域中备受推崇的软件。 在有限元分析领域&#xff0c;…

NLP论文速读(剑桥大学出品)|分解和利用专家模型中的偏好进行改进视觉模型的可信度

论文速读|Decompose and Leverage Preferences from Expert Models for Improving Trustworthiness of MLLMs 论文信息&#xff1a; 简介&#xff1a; 本文探讨的背景是多模态大型语言模型&#xff08;MLLMs&#xff09;&#xff0c;这类模型通过结合视觉特征和文本空间来增强语…

IntelliJ IDEA 中,自动导包功能

在 IntelliJ IDEA 中&#xff0c;自动导包功能可以极大地提高开发效率&#xff0c;减少手动导入包所带来的繁琐和错误。以下是如何在 IntelliJ IDEA 中设置和使用自动导包功能的详细步骤&#xff1a; 一、设置自动导包 打开 IntelliJ IDEA&#xff1a; 启动 IntelliJ IDEA 并打…