EyeSee 官網:https://eyesee.cht.com.tw/


申請帳號(用HINET線路HN申請)
申請好了之後

1.監測報表->寬頻上網->加值服務管理

Hinet eyeSee申請DNS IP反解

文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

NetYea套件新增Line@漂浮圖標
在電腦版或是手機板都能讓客戶更容易找到你
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

1. 到 Github 下載 tesseract-ocr-w64-setup-5.3.3.20231005.exe 來安裝Tesseract。

2. 記錄Tesseract安裝的路徑,預設路徑通常為 C:\Program Files\Tesseract-OCR。

3. 將Tesseract.exe路徑新增到環境變數中

 

  1. pip install pytesseract
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

Python中執行Pytesseract模組錯誤  - 錯誤訊息

  1. raise TesseractNotFoundError()
  2. pytesseract.pytesseract.TesseractNotFoundError: tesseract is not installed or it's not in your PATH. See README file for more information.
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

在測試 mnist 數字辨識時

代碼來源
https://hackmd.io/@Maxlight/SkuYB0w6_#3-hyperparameter
 

  1. import torch
  2. from torch.utils import data as data_
  3. import torch.nn as nn
  4. from torch.autograd import Variable
  5. import matplotlib.pyplot as plt
  6. import torchvision
  7. import os
  8.  
  9. EPOCH = 1
  10. BATCH_SIZE = 50
  11. LR = 0.001
  12. DOWNLOAD_MNIST = False
  13.  
  14. train_data = torchvision.datasets.MNIST(root = './mnist',train = True,transform = torchvision.transforms.ToTensor(),download = DOWNLOAD_MNIST)
  15.  
  16. print(train_data.train_data.size())
  17. print(train_data.train_labels.size())
  18. plt.ion()
  19. for i in range(11):
  20.   plt.imshow(train_data.train_data[i].numpy(), cmap = 'gray')
  21.   plt.title('%i' % train_data.train_labels[i])
  22.   plt.pause(0.5)
  23. plt.show()
  24.  
  25. train_loader = data_.DataLoader(dataset = train_data, batch_size = BATCH_SIZE, shuffle = True,num_workers = 2)
  26.  
  27. test_data = torchvision.datasets.MNIST(root = './mnist/', train = False)
  28. test_x = torch.unsqueeze(test_data.test_data, dim = 1).type(torch.FloatTensor)[:2000]/255.
  29. test_y = test_data.test_labels[:2000]
  30.  
  31. class CNN(nn.Module):
  32.   def __init__(self):
  33.     super(CNN, self).__init__()
  34.     self.conv1 = nn.Sequential(
  35.         nn.Conv2d(in_channels = 1, out_channels = 16, kernel_size = 5, stride = 1, padding = 2,),# stride = 1, padding = (kernel_size-1)/2 = (5-1)/2
  36.         nn.ReLU(),
  37.         nn.MaxPool2d(kernel_size = 2),
  38.     )
  39.     self.conv2 = nn.Sequential(
  40.         nn.Conv2d(16, 32, 5, 1, 2),
  41.         nn.ReLU(),
  42.         nn.MaxPool2d(2)
  43.     )
  44.     self.out = nn.Linear(32*7*7, 10)
  45.  
  46.   def forward(self, x):
  47.     x = self.conv1(x)
  48.     x = self.conv2(x)
  49.     x = x.view(x.size(0), -1)
  50.     output = self.out(x)
  51.     return output, x
  52.  
  53. cnn = CNN()
  54. print(cnn)
  55.  
  56. optimization = torch.optim.Adam(cnn.parameters(), lr = LR)
  57. loss_func = nn.CrossEntropyLoss()
  58.  
  59. for epoch in range(EPOCH):
  60.   for step, (batch_x, batch_y) in enumerate(train_loader):
  61.     bx = Variable(batch_x)
  62.     by = Variable(batch_y)
  63.     output = cnn(bx)[0]
  64.     loss = loss_func(output, by)
  65.     optimization.zero_grad()
  66.     loss.backward()
  67.     optimization.step()
  68.  
  69.     if step % 50 == 0:
  70.         test_output, last_layer = cnn(test_x)
  71.         pred_y = torch.max(test_output, 1)[1].data.numpy()
  72.         accuracy = float((pred_y == test_y.data.numpy()).astype(int).sum()) / float(test_y.size(0))
  73.         print('Epoch: ', epoch, '| train loss: %.4f' % loss.data.numpy(), '| test accuracy: %.2f' % accuracy)
  74.  
  75. test_output, _ = cnn(test_x[:10])
  76. pred_y = torch.max(test_output, 1)[1].data.numpy()
  77. print(pred_y, 'prediction number')
  78. print(test_y[:10].numpy(), 'real number')
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

ubuntu firefox播放久了,突然不能用了
顯示
ubuntu firefox youtube cannot play

ubuntu firefox youtube cannot
ubuntu firefox youtube cannot
安裝插件

文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

結果圖:
Yolov8 照片偵測後如何抓物體座標位置

座標:

  1. [[ 16 290]
  2. [412 491]
  3. [740 626]
  4. [283 631]
  5. [146 651]
  6. [ 32 710]]
  7. 5.0
  8. image 1/1 D:\yolo\bus.jpg: 640x480 4 persons, 1 bus, 1 stop sign, 83.9ms
  9. Speed: 3.0ms preprocess, 83.9ms inference, 4.0ms postprocess per image at shape (1, 3, 640, 480)
  10. tensor([[ 22.3412, 228.0822, 802.0841, 754.3939]], device='cuda:0')
  11. 準確率 0.879738450050354
  12. x,y: [[412 491]]
  13. 0.0
  14. tensor([[ 47.5999, 398.8344, 244.2552, 903.1386]], device='cuda:0')
  15. 準確率 0.873720109462738
  16. x,y: [[146 651]]
  17. 0.0
  18. tensor([[670.3670, 376.9174, 810.0000, 875.0829]], device='cuda:0')
  19. 準確率 0.8693700432777405
  20. x,y: [[740 626]]
  21. 0.0
  22. tensor([[220.5713, 405.7240, 344.5589, 857.2506]], device='cuda:0')
  23. 準確率 0.819391667842865
  24. x,y: [[283 631]]
  25. 11.0
  26. tensor([[7.7698e-02, 2.5441e+02, 3.2119e+01, 3.2465e+02]], device='cuda:0')
  27. 準確率 0.44594067335128784
  28. x,y: [[ 16 290]]
  29. 0.0
  30. tensor([[3.2650e-02, 5.4988e+02, 6.4001e+01, 8.6930e+02]], device='cuda:0')
  31. 準確率 0.29976797103881836
  32. x,y: [[ 32 710]]
  33.  
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

訓練強大且準確的目標偵測模型需要全面的資料集。本指南介紹了與 Ultralytics YOLO 模型相容的各種資料集格式,並深入了解其結構、用法以及如何在不同格式之間進行轉換。



支援的資料集格式Ultralytics YOLO 格式

文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

Yolov8 AttributeError: 'str' o
  1. Model summary (fused): 168 layers, 3011108 parameters, 0 gradients
  2.                  Class     Images  Instances      Box(P          R      mAP50  mAP50-95): 100%|██████████| 1/1 [00:00<00:00, 45.58it/s]
  3.                    all         12         12          0          0          0          0
  4. Traceback (most recent call last):
  5.   File "D:\yolo\testyolo.py", line 13, in <module>
  6.     model.train(data="data.yaml",
  7.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\model.py", line 334, in train
  8.     self.trainer.train()
  9.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\trainer.py", line 195, in train
  10.     self._do_train(world_size)
  11.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\trainer.py", line 418, in _do_train
  12.     self.final_eval()
  13.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\trainer.py", line 573, in final_eval
  14.     self.metrics = self.validator(model=f)
  15.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
  16.     return func(*args, **kwargs)
  17.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\engine\validator.py", line 190, in __call__
  18.     self.print_results()
  19.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\models\yolo\detect\val.py", line 165, in print_results
  20.     names=self.names.values(),
  21. AttributeError: 'str' object has no attribute 'values'
  22. Exception in thread Thread-12 (plot_images):
  23. Traceback (most recent call last):
  24.   File "D:\ProgramData\Anaconda3\envs\python310\lib\threading.py", line 1009, in _bootstrap_inner
  25.     self.run()
  26.   File "D:\ProgramData\Anaconda3\envs\python310\lib\threading.py", line 946, in run
  27.     self._target(*self._args, **self._kwargs)
  28.   File "D:\ProgramData\Anaconda3\envs\python310\lib\site-packages\ultralytics\utils\plotting.py", line 442, in plot_images
  29.     c = names.get(c, c) if names else c
  30. AttributeError: 'str' object has no attribute 'get'
  31.  
  32. Process finished with exit code 1
  33.  
複製代碼
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()

官方文件鏈結 https://docs.ultralytics.com/models/

程式碼

  1. from ultralytics import YOLO
  2. import os
  3. os.environ["KMP_DUPLICATE_LIB_OK"]  =  "TRUE"
  4.  
  5. if __name__ == '__main__':
  6.     # Load a COCO-pretrained YOLOv8n model
  7.     model = YOLO('yolov8n.pt')
  8.  
  9.     # Display model information (optional)
  10.     model.info()
  11.  
  12.     # Train the model on the COCO8 example dataset for 100 epochs
  13.     results = model.train(data='coco8.yaml', epochs=100, imgsz=640)
  14.  
  15.     # Run inference with the YOLOv8n model on the 'bus.jpg' image
  16.     results = model('bus.jpg')
文章標籤

NetYea 網頁設計 發表在 痞客邦 留言(0) 人氣()