# SAM2应用 **Repository Path**: woyaofadacai/sam2-application ## Basic Information - **Project Name**: SAM2应用 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-11-04 - **Last Updated**: 2024-11-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SAM2应用--快速抠图工具 #### 介绍 基于Meta最新发布的SAM2(Segment Anything Model 2)模型开发的智能抠图应用。该工具提供简单直观的交互界面,只需点击目标区域即可实现精确的图像分割和背景去除。 #### 安装教程 1.克隆项目 2.安装依赖`pip install -r requirements.txt` 3.根据需求下载对应的SAM2模型(这里下载的是sam2.1_hiera_tiny.pt)https://github.com/facebookresearch/sam2 #### 项目结构 ``` sam2/ ├── main.py # 主程序入口 ├── output/ # 输出结果 ├── requirements.txt # 项目依赖 └── segment-anything-2/ # SAM2模型目录 └── checkpoints/ # 模型权重文件 ``` #### 使用说明 1. 启动应用 python main.py 2. 打开浏览器访问网址http://127.0.0.1:7860 3. 操作步骤: 上传需要处理的图片 点击图片上要分割的目标位置(可多次点击) 点击"开始分割"按钮 结果自动保存在output目录