91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡(jiǎn)介

https://blog.csdn.net/zugexiaodui/article/details/84379028 自己做的一點(diǎn)樣本,有knn數(shù)字分類代碼,與上邊鏈接中我的博客相對(duì)應(yīng)的。

資源截圖

代碼片段和文件信息

import?numpy?as?np
import?cv2
def?testOne(n):
????test_img?=?cv2.imread(r“test_30/img“+str(n)+“.png“?0)??#自己手寫(xiě)的圖片,圖片名都是img_n.jpg,n是圖片的真實(shí)標(biāo)簽減1,當(dāng)時(shí)寫(xiě)圖片的時(shí)候沒(méi)處理好。
????test_img?=?cv2.pyrDown(cv2.pyrDown(cv2.pyrDown(test_img)))?#縮小圖片尺寸
????test_img[test_img?????test_img[test_img?>=?127]?=?0#使矩陣中每個(gè)小于127的值賦值為0
????#?上邊的兩句話順序不可以顛倒
????test_img=np.reshape(test_img[12251])?#每個(gè)圖片都展開(kāi)成一維向量
????#?print(test_img.shape)
????train_img=np.load(“trainIMG.npy“)?#?這里提前處理好了訓(xùn)練樣本的矩陣,一共有100個(gè)樣本,矩陣shape為[1225100]
????train_lbl=np.load(“trainLabels.npy“)?#?這是提前處理好的訓(xùn)練標(biāo)簽的矩陣[100]
????#?print(train_img.shape)
????#?print(train_lbl.shape)
????distance=np.sum(np.square(train_img?-?test_img)axis=0)?#?計(jì)算距離,不是必須開(kāi)方的,節(jié)省運(yùn)算
????#?distance?=?np.sqrt(np.sum(np.square(train_img?-?test_im

?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-16?17:32??ML_PG\
?????目錄???????????0??2018-05-07?19:57??ML_PG\.idea\
?????文件?????????398??2018-05-04?22:00??ML_PG\.idea\ML_PG.iml
?????目錄???????????0??2018-05-07?19:57??ML_PG\.idea\dictionaries\
?????文件??????????86??2018-05-04?22:00??ML_PG\.idea\dictionaries\LUYUE.xml
?????目錄???????????0??2018-05-07?19:57??ML_PG\.idea\inspectionProfiles\
?????文件????????8524??2018-05-04?22:00??ML_PG\.idea\inspectionProfiles\Project_Default.xml
?????文件?????????226??2018-05-04?22:00??ML_PG\.idea\misc.xml
?????文件?????????262??2018-05-04?22:00??ML_PG\.idea\modules.xml
?????文件???????13768??2018-05-05?10:59??ML_PG\.idea\workspace.xml
?????文件?????????160??2018-05-04?22:12??ML_PG\IMG_b.npy
?????文件???????98080??2018-05-04?22:12??ML_PG\IMG_w.npy
?????文件????????2207??2018-11-23?11:51??ML_PG\knn.py
?????文件???????36830??2018-05-04?22:10??ML_PG\testIMG.npy
?????文件?????????380??2018-05-04?22:10??ML_PG\testLAB.npy
?????文件?????????200??2018-05-04?22:10??ML_PG\testLabels.npy
?????目錄???????????0??2018-05-07?19:57??ML_PG\test_30\
?????文件????????2772??2018-01-04?15:43??ML_PG\test_30\img1.png
?????文件????????2861??2018-01-04?15:44??ML_PG\test_30\img10.png
?????文件????????2722??2018-01-04?15:44??ML_PG\test_30\img11.png
?????文件????????2104??2018-01-04?15:44??ML_PG\test_30\img12.png
?????文件????????2317??2018-01-04?15:44??ML_PG\test_30\img13.png
?????文件????????2526??2018-01-04?15:44??ML_PG\test_30\img14.png
?????文件????????2898??2018-01-04?15:44??ML_PG\test_30\img15.png
?????文件????????2548??2018-01-04?15:44??ML_PG\test_30\img16.png
?????文件????????2643??2018-01-04?15:44??ML_PG\test_30\img17.png
?????文件????????2263??2018-01-04?15:44??ML_PG\test_30\img18.png
?????文件????????2928??2018-01-04?15:44??ML_PG\test_30\img19.png
?????文件????????2101??2018-01-04?15:43??ML_PG\test_30\img2.png
?????文件????????2828??2018-01-04?15:44??ML_PG\test_30\img20.png
?????文件????????2696??2018-01-04?15:44??ML_PG\test_30\img21.png
............此處省略121個(gè)文件信息

評(píng)論

共有 條評(píng)論

相關(guān)資源