# 导入必要的库
import numpy as np
import torch
import matplotlib.pyplot as plt
from PIL import Image
import requests
from io import BytesIO

# 从 SAM 2 库中导入图像预测器和模型构建工具
from sam2.build_sam import build_sam2
from sam2.sam2_image_predictor import SAM2ImagePredictor