1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
| (.venv) PS X:\1LowLightImaging\LowLightEnhancementTest1> python main.py 使用CPU 开始训练... Epoch 1/50: 100%|██████████████████████████████████████████████████████| 250/250 [12:00<00:00, 2.88s/it, Loss=0.8483, Pixel=0.2935, SSIM=0.6660, Color=0.2563] Epoch [1/50], 平均损失: 0.7933 Epoch 2/50: 100%|██████████████████████████████████████████████████████| 250/250 [12:17<00:00, 2.95s/it, Loss=0.4654, Pixel=0.1679, SSIM=0.3750, Color=0.1090] Epoch [2/50], 平均损失: 0.7065 Epoch 3/50: 100%|██████████████████████████████████████████████████████| 250/250 [11:49<00:00, 2.84s/it, Loss=0.5471, Pixel=0.1682, SSIM=0.5130, Color=0.1355] Epoch [3/50], 平均损失: 0.6788 Epoch 4/50: 100%|██████████████████████████████████████████████████████| 250/250 [11:52<00:00, 2.85s/it, Loss=0.3635, Pixel=0.1391, SSIM=0.2530, Color=0.0772] Epoch [4/50], 平均损失: 0.6897 Epoch 5/50: 100%|██████████████████████████████████████████████████████| 250/250 [12:17<00:00, 2.95s/it, Loss=0.7517, Pixel=0.2841, SSIM=0.5601, Color=0.2722] Epoch [5/50], 平均损失: 0.6952 模型已保存: checkpoints\model_epoch_5.pth Epoch 6/50: 100%|██████████████████████████████████████████████████████| 250/250 [13:32<00:00, 3.25s/it, Loss=0.4852, Pixel=0.1922, SSIM=0.3064, Color=0.1449] Epoch [6/50], 平均损失: 0.6575 Epoch 7/50: 100%|██████████████████████████████████████████████████████| 250/250 [14:07<00:00, 3.39s/it, Loss=0.6137, Pixel=0.1620, SSIM=0.6454, Color=0.1299] Epoch [7/50], 平均损失: 0.6581 Epoch 8/50: 100%|██████████████████████████████████████████████████████| 250/250 [11:41<00:00, 2.81s/it, Loss=0.5953, Pixel=0.2345, SSIM=0.3729, Color=0.2199] Epoch [8/50], 平均损失: 0.6480 Epoch 9/50: 100%|██████████████████████████████████████████████████████| 250/250 [11:50<00:00, 2.84s/it, Loss=0.5371, Pixel=0.1628, SSIM=0.5241, Color=0.1415] Epoch [9/50], 平均损失: 0.6386 Epoch 10/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:23<00:00, 2.97s/it, Loss=0.6540, Pixel=0.2281, SSIM=0.5344, Color=0.2072] Epoch [10/50], 平均损失: 0.6292 模型已保存: checkpoints\model_epoch_10.pth Epoch 11/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:18<00:00, 2.95s/it, Loss=0.6679, Pixel=0.2032, SSIM=0.6354, Color=0.1698] Epoch [11/50], 平均损失: 0.6313 Epoch 12/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:28<00:00, 2.99s/it, Loss=0.5549, Pixel=0.2019, SSIM=0.4569, Color=0.1175] Epoch [12/50], 平均损失: 0.6333 Epoch 13/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:08<00:00, 2.91s/it, Loss=0.7904, Pixel=0.2187, SSIM=0.8591, Color=0.1526] Epoch [13/50], 平均损失: 0.6282 Epoch 14/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:53<00:00, 2.85s/it, Loss=0.8170, Pixel=0.3041, SSIM=0.6440, Color=0.2851] Epoch [14/50], 平均损失: 0.6216 Epoch 15/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:15<00:00, 2.94s/it, Loss=0.9742, Pixel=0.2616, SSIM=1.0505, Color=0.2337] Epoch [15/50], 平均损失: 0.6210 模型已保存: checkpoints\model_epoch_15.pth Epoch 16/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:45<00:00, 2.82s/it, Loss=0.7377, Pixel=0.2339, SSIM=0.6444, Color=0.2245] Epoch [16/50], 平均损失: 0.6097 Epoch 17/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:39<00:00, 2.80s/it, Loss=0.4855, Pixel=0.2083, SSIM=0.3328, Color=0.1321] Epoch [17/50], 平均损失: 0.6094 Epoch 18/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:07<00:00, 2.91s/it, Loss=0.5712, Pixel=0.1896, SSIM=0.5141, Color=0.1224] Epoch [18/50], 平均损失: 0.6238 Epoch 19/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:42<00:00, 2.81s/it, Loss=0.4439, Pixel=0.1738, SSIM=0.3200, Color=0.1197] Epoch [19/50], 平均损失: 0.6128 Epoch 20/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:09<00:00, 2.92s/it, Loss=0.5439, Pixel=0.1402, SSIM=0.6391, Color=0.0879] Epoch [20/50], 平均损失: 0.6032 模型已保存: checkpoints\model_epoch_20.pth Epoch 21/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:43<00:00, 2.81s/it, Loss=0.3819, Pixel=0.1400, SSIM=0.2576, Color=0.0998] Epoch [21/50], 平均损失: 0.6104 Epoch 22/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:42<00:00, 2.81s/it, Loss=0.4719, Pixel=0.1804, SSIM=0.3357, Color=0.1461] Epoch [22/50], 平均损失: 0.6071 Epoch 23/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:47<00:00, 2.83s/it, Loss=0.3669, Pixel=0.1519, SSIM=0.2029, Color=0.1059] Epoch [23/50], 平均损失: 0.6146 Epoch 24/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:43<00:00, 2.81s/it, Loss=0.3853, Pixel=0.1435, SSIM=0.2938, Color=0.1093] Epoch [24/50], 平均损失: 0.6022 Epoch 25/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:27<00:00, 2.99s/it, Loss=0.4153, Pixel=0.1416, SSIM=0.3560, Color=0.0951] Epoch [25/50], 平均损失: 0.6010 模型已保存: checkpoints\model_epoch_25.pth Epoch 26/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:56<00:00, 2.87s/it, Loss=0.3997, Pixel=0.1333, SSIM=0.3410, Color=0.0960] Epoch [26/50], 平均损失: 0.5873 Epoch 27/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:55<00:00, 2.86s/it, Loss=0.8101, Pixel=0.3001, SSIM=0.6643, Color=0.2615] Epoch [27/50], 平均损失: 0.5867 Epoch 28/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:53<00:00, 2.85s/it, Loss=0.7385, Pixel=0.2320, SSIM=0.7444, Color=0.1896] Epoch [28/50], 平均损失: 0.5910 Epoch 29/50: 100%|█████████████████████████████████████████████████████| 250/250 [33:20<00:00, 8.00s/it, Loss=0.6486, Pixel=0.2622, SSIM=0.4462, Color=0.1762] Epoch [29/50], 平均损失: 0.5969 Epoch 30/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:28<00:00, 3.00s/it, Loss=0.6403, Pixel=0.2340, SSIM=0.5194, Color=0.1815] Epoch [30/50], 平均损失: 0.5869 模型已保存: checkpoints\model_epoch_30.pth Epoch 31/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:56<00:00, 2.86s/it, Loss=0.4417, Pixel=0.1907, SSIM=0.2741, Color=0.1328] Epoch [31/50], 平均损失: 0.5820 Epoch 32/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:00<00:00, 2.88s/it, Loss=0.4848, Pixel=0.1526, SSIM=0.4477, Color=0.1153] Epoch [32/50], 平均损失: 0.5936 Epoch 33/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:13<00:00, 2.94s/it, Loss=0.3727, Pixel=0.1471, SSIM=0.2684, Color=0.0778] Epoch [33/50], 平均损失: 0.5758 Epoch 34/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:47<00:00, 2.83s/it, Loss=0.7852, Pixel=0.2791, SSIM=0.6393, Color=0.2493] Epoch [34/50], 平均损失: 0.5752 Epoch 35/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:49<00:00, 2.84s/it, Loss=0.5436, Pixel=0.1767, SSIM=0.4980, Color=0.1459] Epoch [35/50], 平均损失: 0.5751 模型已保存: checkpoints\model_epoch_35.pth Epoch 36/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:48<00:00, 2.84s/it, Loss=0.7050, Pixel=0.2337, SSIM=0.6425, Color=0.2013] Epoch [36/50], 平均损失: 0.5854 Epoch 37/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:52<00:00, 2.85s/it, Loss=0.6237, Pixel=0.2212, SSIM=0.4791, Color=0.1972] Epoch [37/50], 平均损失: 0.5793 Epoch 38/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:14<00:00, 2.94s/it, Loss=0.5081, Pixel=0.1675, SSIM=0.4498, Color=0.1130] Epoch [38/50], 平均损失: 0.5837 Epoch 39/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:52<00:00, 2.85s/it, Loss=0.5661, Pixel=0.1688, SSIM=0.5630, Color=0.1357] Epoch [39/50], 平均损失: 0.5684 Epoch 40/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:51<00:00, 2.84s/it, Loss=0.3492, Pixel=0.1239, SSIM=0.2821, Color=0.0926] Epoch [40/50], 平均损失: 0.5621 模型已保存: checkpoints\model_epoch_40.pth Epoch 41/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:02<00:00, 2.89s/it, Loss=0.7467, Pixel=0.2464, SSIM=0.6612, Color=0.2358] Epoch [41/50], 平均损失: 0.5739 Epoch 42/50: 100%|█████████████████████████████████████████████████████| 250/250 [18:55<00:00, 4.54s/it, Loss=0.6710, Pixel=0.2475, SSIM=0.5524, Color=0.1679] Epoch [42/50], 平均损失: 0.5621 Epoch 43/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:06<00:00, 2.91s/it, Loss=0.4863, Pixel=0.1543, SSIM=0.4490, Color=0.1294] Epoch [43/50], 平均损失: 0.5787 Epoch 44/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:40<00:00, 2.80s/it, Loss=0.6082, Pixel=0.2096, SSIM=0.5313, Color=0.1611] Epoch [44/50], 平均损失: 0.5604 Epoch 45/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:40<00:00, 2.80s/it, Loss=0.6087, Pixel=0.2249, SSIM=0.4806, Color=0.1768] Epoch [45/50], 平均损失: 0.5657 模型已保存: checkpoints\model_epoch_45.pth Epoch 46/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:41<00:00, 2.81s/it, Loss=0.6111, Pixel=0.1542, SSIM=0.6984, Color=0.1170] Epoch [46/50], 平均损失: 0.5714 Epoch 47/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:46<00:00, 2.83s/it, Loss=0.9169, Pixel=0.2665, SSIM=0.9167, Color=0.2502] Epoch [47/50], 平均损失: 0.5781 Epoch 48/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:06<00:00, 2.91s/it, Loss=0.6007, Pixel=0.2049, SSIM=0.5396, Color=0.1573] Epoch [48/50], 平均损失: 0.5612 Epoch 49/50: 100%|█████████████████████████████████████████████████████| 250/250 [11:44<00:00, 2.82s/it, Loss=0.8744, Pixel=0.2294, SSIM=0.9773, Color=0.1978] Epoch [49/50], 平均损失: 0.5508 Epoch 50/50: 100%|█████████████████████████████████████████████████████| 250/250 [12:09<00:00, 2.92s/it, Loss=0.5267, Pixel=0.1442, SSIM=0.5780, Color=0.1052] Epoch [50/50], 平均损失: 0.5608 模型已保存: checkpoints\model_epoch_50.pth 最终模型已保存: checkpoints\final_model.pth (.venv) PS X:\1LowLightImaging\LowLightEnhancementTest1> python test_inference.py 使用CPU 模型加载成功! 增强后的图像已保存: enhanced_results\enhanced_489.png 增强后的图像已保存: enhanced_results\enhanced_490.png 增强后的图像已保存: enhanced_results\enhanced_469.png 增强后的图像已保存: enhanced_results\enhanced_470.png 增强后的图像已保存: enhanced_results\enhanced_471.png 增强后的图像已保存: enhanced_results\enhanced_472.png 增强后的图像已保存: enhanced_results\enhanced_478.png 增强后的图像已保存: enhanced_results\enhanced_479.png 增强后的图像已保存: enhanced_results\enhanced_480.png 增强后的图像已保存: enhanced_results\enhanced_481.png 增强后的图像已保存: enhanced_results\enhanced_487.png 增强后的图像已保存: enhanced_results\enhanced_488.png (.venv) PS X:\1LowLightImaging\LowLightEnhancementTest1>
|