recognize-anything 识别万物

docker   run   --gpus all  -itd --name=test -v /app:/app  nvcr.io/nvidia/cuda:11.8.0-devel-ubuntu22.04


###########安装过程########################

# 更新包索引
apt update

# 安装 Python 3
apt install python3 -y

# 安装 pip
apt install python3-pip -y

# 安装 Git
apt install git -y

# 安装 ffmpeg 和一些图形相关的库
apt-get install ffmpeg libsm6 libxext6 -y

# 安装 OpenGL 库
apt-get install libgl1 -y

# 将 Python 3 的可执行文件复制到一个更通用的命令名
cp /usr/bin/python3 /usr/bin/python

# 安装 wget
apt-get install -y wget

# 克隆 “recognize-anything” 项目
git clone https://github.com/xinyu1205/recognize-anything.git

# 进入项目文件夹
cd recognize-anything/

# 安装一些 Python 包
pip install timm transformers fairscale pycocoevalcap

# 安装项目所需的所有依赖项
pip install -r requirements.txt

# 创建并进入一个名为 `pretrained` 的文件夹
mkdir pretrained
cd pretrained

# 使用 wget 下载预训练模型
wget https://huggingface.co/xinyu1205/recognize-anything-plus-model/resolve/main/ram_plus_swin_large_14m.pth
wget https://huggingface.co/xinyu1205/recognize-anything-plus-model/resolve/main/ram_plus_tag_embedding_class_4585_des_51.pth
wget https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text/resolve/main/ram_swin_large_14m.pth
wget https://huggingface.co/spaces/xinyu1205/Recognize_Anything-Tag2Text/resolve/main/tag2text_swin_14m.pth
 

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

启动脚本如下

 python inference_ram_plus.py  --image images/demo/demo1.jpg \
> --pretrained pretrained/ram_plus_swin_large_14m.pth

你可能感兴趣的:(langchain)