当前位置:首页>python>一天一个Python知识点——Day 158:图像分割

一天一个Python知识点——Day 158:图像分割

  • 2026-02-28 01:14:54
一天一个Python知识点——Day 158:图像分割

一、开篇:从“这是什么”到“哪里是什么”

前两天的学习中,我们掌握了:

  • 图像特征提取:找到图像中的关键点,并生成描述符(第158天)

  • OpenCV基础:处理图像的基本操作(第157天)

但特征提取只能告诉我们“这里有角点”,目标检测只能告诉我们“这里有猫”。如果我们想知道猫的轮廓在哪里天空和道路的边界在哪里,就需要更精细的理解——图像分割

图像分割 = 将图像划分为若干具有语义含义的区域

如果说分类是回答“这是什么”,检测是回答“它在哪(框)”,那么分割就是回答“它占据哪些像素”

二、图像分割的三种层次

2.1 语义分割(Semantic Segmentation)

任务:给图像中的每个像素分配一个类别标签。

  • 所有“猫”像素标为类别1,所有“狗”像素标为类别2

  • 不区分个体——两只猫的像素都算“猫”

输出:与输入同尺寸的“标签图”(每个像素一个整数)

2.2 实例分割(Instance Segmentation)

任务:不仅要分割出物体,还要区分不同的个体。

  • 猫A的像素标为1,猫B的像素标为2

  • 结合了目标检测(个体识别)和语义分割(像素级分类)

输出:每个实例的掩膜(Mask)

2.3 全景分割(Panoptic Segmentation)

任务:语义分割 + 实例分割的统一。

  • 将图像分为两类:stuff( amorphous 区域,如天空、草地)和things(可数物体,如人、车)

  • 对stuff做语义分割,对things做实例分割

三种分割的对比

原始图像:两只猫在草地上语义分割:所有猫像素=猫,草地像素=草地实例分割:猫A掩膜,猫B掩膜,草地像素=草地全景分割:猫A掩膜,猫B掩膜,草地像素=草地(stuff)

三、传统图像分割方法(前深度学习时代)

在深度学习普及之前,图像分割主要依靠手工特征和经典算法。这些方法至今仍在某些场景下有用。

3.1 阈值分割(Thresholding)

最简单的分割方法:根据像素灰度值划分。

import cv2import numpy as np# 读取灰度图img = cv2.imread('coins.jpg', cv2.IMREAD_GRAYSCALE)# 全局阈值ret, thresh1 = cv2.threshold(img, 127255, cv2.THRESH_BINARY)# 自适应阈值(考虑局部亮度变化)thresh2 = cv2.adaptiveThreshold(img, 255, cv2.ADAPTIVE_THRESH_MEAN_C,                                cv2.THRESH_BINARY, 112)# Otsu's 二值化(自动计算最优阈值)ret2, thresh3 = cv2.threshold(img, 0255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)cv2.imshow('Original', img)cv2.imshow('Global', thresh1)cv2.imshow('Adaptive', thresh2)cv2.imshow('Otsu', thresh3)cv2.waitKey(0)

适用场景:前景背景对比明显的图像(如文档扫描、细胞计数)。

3.2 分水岭算法(Watershed)

将图像视为地形图,像素灰度值为高度,模拟水从低处漫延的过程,最终在山脊处形成分割边界。

import cv2import numpy as np# 读取图像并二值化img = cv2.imread('coins.jpg')gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)ret, thresh = cv2.threshold(gray, 0255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)# 去除噪声kernel = np.ones((3,3), np.uint8)opening = cv2.morphologyEx(thresh, cv2.MORPH_OPEN, kernel, iterations=2)# 确定背景区域sure_bg = cv2.dilate(opening, kernel, iterations=3)# 确定前景区域dist_transform = cv2.distanceTransform(opening, cv2.DIST_L2, 5)ret, sure_fg = cv2.threshold(dist_transform, 0.7 * dist_transform.max(), 2550)# 找到未知区域sure_fg = np.uint8(sure_fg)unknown = cv2.subtract(sure_bg, sure_fg)# 标记连通组件ret, markers = cv2.connectedComponents(sure_fg)markers = markers + 1markers[unknown == 255] = 0# 应用分水岭markers = cv2.watershed(img, markers)img[markers == -1] = [0, 0, 255]  # 边界标记为红色cv2.imshow('Watershed', img)cv2.waitKey(0)

适用场景:分离相互接触的物体(如硬币、细胞)。

3.3 区域生长(Region Growing)

从种子点开始,逐渐合并相似邻域像素。

def region_growing(img, seed, threshold=10):    """简单区域生长算法"""    h, w = img.shape    segmented = np.zeros((h, w), dtype=np.uint8)    visited = np.zeros((h, w), dtype=bool)    seed_value = img[seed]    queue = [seed]    visited[seed] = True    while queue:        x, y = queue.pop(0)        segmented[x, y] = 255        # 检查4邻域        for dx, dy in [(1,0), (-1,0), (0,1), (0,-1)]:            nx, ny = x + dx, y + dy            if 0 <= nx < h and 0 <= ny < w and not visited[nx, ny]:                if abs(int(img[nx, ny]) - int(seed_value)) < threshold:                    visited[nx, ny] = True                    queue.append((nx, ny))    return segmented

适用场景:交互式分割,医学图像中的特定器官提取。

四、深度学习时代的图像分割革命

2015年,全卷积网络(FCN) 的提出标志着图像分割进入深度学习时代。

4.1 全卷积网络(FCN)—— 端到端像素预测

核心思想:将分类网络的最后全连接层替换为卷积层,输出与输入同尺寸的“热力图”。

关键创新

  • 上采样:通过转置卷积(反卷积)恢复空间尺寸

  • 跳跃连接:融合深层语义信息和浅层细节信息

import torchimport torch.nn as nnclass FCN8s(nn.Module):    """简化版FCN-8s"""    def __init__(self, num_classes):        super().__init__()        # 编码器(VGG前几层)        self.conv1 = nn.Sequential(            nn.Conv2d(3643, padding=1), nn.ReLU(),            nn.Conv2d(64643, padding=1), nn.ReLU(),            nn.MaxPool2d(2)        )        self.conv2 = nn.Sequential(            nn.Conv2d(641283, padding=1), nn.ReLU(),            nn.Conv2d(1281283, padding=1), nn.ReLU(),            nn.MaxPool2d(2)        )        self.conv3 = nn.Sequential(            nn.Conv2d(1282563, padding=1), nn.ReLU(),            nn.Conv2d(2562563, padding=1), nn.ReLU(),            nn.Conv2d(2562563, padding=1), nn.ReLU(),            nn.MaxPool2d(2)        )        # ... 更多层        # 上采样与跳跃连接        self.score_pool3 = nn.Conv2d(256, num_classes, 1)        self.upscore2 = nn.ConvTranspose2d(num_classes, num_classes, 4, stride=2, padding=1)        self.upscore8 = nn.ConvTranspose2d(num_classes, num_classes, 16, stride=8, padding=4)    def forward(self, x):        h = self.conv1(x)        h = self.conv2(h)        h = self.conv3(h)        # 上采样与跳跃连接        score = self.score_pool3(h)        upscore = self.upscore2(score)        # ... 融合更多层        out = self.upscore8(upscore)        return out

4.2 U-Net —— 医学图像分割的王者

结构特点:对称的编码器-解码器结构,加上跳跃连接(Skip Connection),使得网络能够同时利用深层语义和浅层细节。

为什么U-Net在医学图像中表现出色?

  • 医学图像通常边界模糊,需要细节信息

  • 数据集较小,U-Net参数量适中,不易过拟合

import torchimport torch.nn as nnclass DoubleConv(nn.Module):    """(Conv => BN => ReLU) * 2"""    def __init__(self, in_ch, out_ch):        super().__init__()        self.conv = nn.Sequential(            nn.Conv2d(in_ch, out_ch, 3, padding=1),            nn.BatchNorm2d(out_ch),            nn.ReLU(inplace=True),            nn.Conv2d(out_ch, out_ch, 3, padding=1),            nn.BatchNorm2d(out_ch),            nn.ReLU(inplace=True)        )    def forward(self, x):        return self.conv(x)class UNet(nn.Module):    def __init__(self, in_channels=3, out_channels=1):        super().__init__()        # 编码器        self.enc1 = DoubleConv(in_channels, 64)        self.pool1 = nn.MaxPool2d(2)        self.enc2 = DoubleConv(64128)        self.pool2 = nn.MaxPool2d(2)        self.enc3 = DoubleConv(128256)        self.pool3 = nn.MaxPool2d(2)        self.enc4 = DoubleConv(256512)        self.pool4 = nn.MaxPool2d(2)        # 瓶颈        self.bottleneck = DoubleConv(5121024)        # 解码器        self.up4 = nn.ConvTranspose2d(10245122, stride=2)        self.dec4 = DoubleConv(1024512)        self.up3 = nn.ConvTranspose2d(5122562, stride=2)        self.dec3 = DoubleConv(512256)        self.up2 = nn.ConvTranspose2d(2561282, stride=2)        self.dec2 = DoubleConv(256128)        self.up1 = nn.ConvTranspose2d(128642, stride=2)        self.dec1 = DoubleConv(12864)        self.out = nn.Conv2d(64, out_channels, 1)    def forward(self, x):        # 编码        e1 = self.enc1(x)        e2 = self.enc2(self.pool1(e1))        e3 = self.enc3(self.pool2(e2))        e4 = self.enc4(self.pool3(e3))        # 瓶颈        b = self.bottleneck(self.pool4(e4))        # 解码 + 跳跃连接        d4 = self.up4(b)        d4 = torch.cat([d4, e4], dim=1)        d4 = self.dec4(d4)        d3 = self.up3(d4)        d3 = torch.cat([d3, e3], dim=1)        d3 = self.dec3(d3)        d2 = self.up2(d3)        d2 = torch.cat([d2, e2], dim=1)        d2 = self.dec2(d2)        d1 = self.up1(d2)        d1 = torch.cat([d1, e1], dim=1)        d1 = self.dec1(d1)        out = self.out(d1)        return out

4.3 DeepLab系列 —— 空洞卷积的威力

DeepLab通过空洞卷积(Atrous Convolution) 扩大感受野,同时保持特征图分辨率,避免下采样带来的信息丢失。

DeepLab v3+ 结合了空间金字塔池化(ASPP)和编码器-解码器结构,是目前最先进的语义分割架构之一。

class ASPP(nn.Module):    """空洞空间金字塔池化"""    def __init__(self, in_ch, out_ch, rates=[61218]):        super().__init__()        self.conv1 = nn.Conv2d(in_ch, out_ch, 1)        self.conv2 = nn.Conv2d(in_ch, out_ch, 3, padding=rates[0], dilation=rates[0])        self.conv3 = nn.Conv2d(in_ch, out_ch, 3, padding=rates[1], dilation=rates[1])        self.conv4 = nn.Conv2d(in_ch, out_ch, 3, padding=rates[2], dilation=rates[2])        self.pool = nn.Sequential(            nn.AdaptiveAvgPool2d(1),            nn.Conv2d(in_ch, out_ch, 1),            nn.Upsample(scale_factor=64, mode='bilinear', align_corners=True)        )        self.final = nn.Conv2d(out_ch * 5, out_ch, 1)    def forward(self, x):        x1 = self.conv1(x)        x2 = self.conv2(x)        x3 = self.conv3(x)        x4 = self.conv4(x)        x5 = self.pool(x)        return self.final(torch.cat([x1, x2, x3, x4, x5], dim=1))

4.4 Mask R-CNN —— 实例分割的标杆

Mask R-CNN = Faster R-CNN(目标检测)+ 并行分支预测掩膜。

核心创新

  • RoIAlign:解决RoI Pooling的量化误差,保留空间位置信息

  • 多任务损失:分类损失 + 框回归损失 + 掩膜损失

五、实战项目:U-Net实现细胞核分割

我们将使用U-Net对显微镜图像进行细胞核分割。

5.1 数据集准备

使用 Kaggle 的 2018 Data Science Bowl 数据集(细胞核分割)。

import osimport cv2import numpy as npimport torchfrom torch.utils.data import Dataset, DataLoaderfrom torchvision import transformsclass NucleiDataset(Dataset):    """细胞核分割数据集"""    def __init__(self, img_dir, mask_dir, transform=None):        self.img_dir = img_dir        self.mask_dir = mask_dir        self.transform = transform        self.images = sorted(os.listdir(img_dir))    def __len__(self):        return len(self.images)    def __getitem__(self, idx):        img_name = self.images[idx]        img_path = os.path.join(self.img_dir, img_name)        mask_path = os.path.join(self.mask_dir, img_name)  # 假设掩膜同名        image = cv2.imread(img_path)        image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)        mask = cv2.imread(mask_path, cv2.IMREAD_GRAYSCALE)        # 归一化        image = image.astype(np.float32) / 255.0        mask = mask.astype(np.float32) / 255.0  # 二值掩膜        # 转成Tensor        image = torch.from_numpy(image).permute(201)        mask = torch.from_numpy(mask).unsqueeze(0)  # (1, H, W)        return image, mask

5.2 损失函数:Dice Loss + BCE

对于医学图像分割,常用Dice系数作为评估指标,其损失函数为 1 - Dice

class DiceBCELoss(nn.Module):    """Dice Loss + Binary Cross Entropy"""    def __init__(self, smooth=1e-6):        super().__init__()        self.smooth = smooth        self.bce = nn.BCEWithLogitsLoss()    def forward(self, pred, target):        pred = torch.sigmoid(pred)  # 转为概率        # Dice Loss        intersection = (pred * target).sum(dim=(2,3))        union = pred.sum(dim=(2,3)) + target.sum(dim=(2,3))        dice = (2.0 * intersection + self.smooth) / (union + self.smooth)        dice_loss = 1 - dice.mean()        # BCE Loss        bce_loss = self.bce(pred, target)        return dice_loss + bce_loss

5.3 训练循环

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')model = UNet(in_channels=3, out_channels=1).to(device)criterion = DiceBCELoss()optimizer = torch.optim.Adam(model.parameters(), lr=1e-4)# 数据加载train_loader = DataLoader(NucleiDataset('train/images''train/masks'),                          batch_size=4, shuffle=True, num_workers=2)for epoch in range(20):    model.train()    total_loss = 0    for images, masks in train_loader:        images, masks = images.to(device), masks.to(device)        optimizer.zero_grad()        outputs = model(images)        loss = criterion(outputs, masks)        loss.backward()        optimizer.step()        total_loss += loss.item()    print(f"Epoch {epoch+1}: Loss = {total_loss/len(train_loader):.4f}")

5.4 预测与可视化

model.eval()with torch.no_grad():    for i, (images, masks) in enumerate(val_loader):        images = images.to(device)        outputs = model(images)        preds = torch.sigmoid(outputs).cpu().numpy()        # 二值化(阈值0.5        preds = (preds > 0.5).astype(np.uint8)        # 显示        import matplotlib.pyplot as plt        fig, axes = plt.subplots(13)        axes[0].imshow(images[0].permute(1,2,0).cpu())        axes[0].set_title('Input')        axes[1].imshow(masks[0][0], cmap='gray')        axes[1].set_title('Ground Truth')        axes[2].imshow(preds[0][0], cmap='gray')        axes[2].set_title('Prediction')        plt.show()        if i > 2: break

六、评估指标

6.1 IoU(Intersection over Union)—— 交并比

IoU = (预测掩膜 ∩ 真实掩膜) / (预测掩膜 ∪ 真实掩膜)
def iou_score(pred, target):    intersection = (pred & target).sum()    union = (pred | target).sum()    if union == 0:        return 1.0  # 都是0,完美    return intersection / union

6.2 Dice系数

Dice = 2 * |A ∩ B| / (|A| + |B|)

等价于 F1分数,在医学图像中更常用。

6.3 像素准确率(Pixel Accuracy)

PA = (正确分类的像素数) / (总像素数)
注意:当类别不平衡时(如背景占95%),PA可能虚高,应结合IoU使用。

七、常用数据集

数据集
任务
图像数
类别
特点
PASCAL VOC 2012
语义分割
2913
20
经典,小规模
MS COCO
实例分割
33万
80
大规模,复杂场景
Cityscapes
语义/实例分割
5000
30
城市街景,精细标注
ADE20K
语义/全景分割
2万
150
场景理解
KITTI
道路场景
数百
多种
自动驾驶
ISIC
皮肤病变分割
数千
1
医学图像

总结:从像素到理解

图像分割是计算机视觉从“看见”走向“理解”的关键一步。它赋予每个像素语义,让机器真正理解场景的构成。

今天,我们从传统方法走到深度学习,从理论走到实战,亲手训练了一个U-Net模型。这些技术正被广泛应用于:

  • 自动驾驶:分割道路、车辆、行人

  • 医疗影像:肿瘤分割、器官提取

  • 卫星遥感:土地覆盖分类

  • 工业质检:缺陷检测

“分割不是终点,而是理解世界的像素级基础。”

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-28 07:13:36 HTTP/2.0 GET : https://f.mffb.com.cn/a/477584.html
  2. 运行时间 : 0.098894s [ 吞吐率:10.11req/s ] 内存消耗:4,303.04kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=6c32c4808e5d5a1ad5d3891d6056df04
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000476s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.000535s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.008740s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000277s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000473s ]
  6. SELECT * FROM `set` [ RunTime:0.000188s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000547s ]
  8. SELECT * FROM `article` WHERE `id` = 477584 LIMIT 1 [ RunTime:0.002943s ]
  9. UPDATE `article` SET `lasttime` = 1772234016 WHERE `id` = 477584 [ RunTime:0.004531s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 66 LIMIT 1 [ RunTime:0.003061s ]
  11. SELECT * FROM `article` WHERE `id` < 477584 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.003240s ]
  12. SELECT * FROM `article` WHERE `id` > 477584 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000397s ]
  13. SELECT * FROM `article` WHERE `id` < 477584 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000850s ]
  14. SELECT * FROM `article` WHERE `id` < 477584 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.004149s ]
  15. SELECT * FROM `article` WHERE `id` < 477584 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000628s ]
0.100498s