Python實(shí)現(xiàn)笑臉檢測+人臉口罩檢測功能
一、人臉圖像特征提取方法
http://www.dbjr.com.cn/article/219446.htm
二、對笑臉數(shù)據(jù)集genki4k進(jìn)行訓(xùn)練和測試(包括SVM、CNN),輸出模型訓(xùn)練精度和測試精度(F1-score和ROC),實(shí)現(xiàn)檢測圖片笑臉和實(shí)時視頻笑臉檢測
(一)環(huán)境、數(shù)據(jù)集準(zhǔn)備
本文操作在Jupyter notebook平臺進(jìn)行,需要安裝tensorflow、Keras庫、Dlib庫、和opencv-python等。
1、安裝tensorflow、Keras庫
http://www.dbjr.com.cn/article/219425.htm
2、win10 + anaconda3 + python3.6 安裝tensorflow + keras的步驟詳解
http://www.dbjr.com.cn/article/171039.htm
3、笑臉數(shù)據(jù)集下載
笑臉數(shù)據(jù)集下載鏈接: http://xiazai.jb51.net/202108/yuanma/smils_jb51.rar
(二)訓(xùn)練笑臉數(shù)據(jù)集genki4k
1、首先導(dǎo)入Keras庫
import keras keras.__version__
2、讀取笑臉數(shù)據(jù)集,然后將訓(xùn)練的數(shù)據(jù)和測試數(shù)據(jù)放入對應(yīng)的文件夾
import os, shutil # The path to the directory where the original # dataset was uncompressed original_dataset_dir = 'C:\\Users\\asus\\Desktop\\test\\genki4k' # The directory where we will # store our smaller dataset base_dir = 'C:\\Users\\asus\\Desktop\\test\\smile_and_nosmile' os.mkdir(base_dir) # Directories for our training, # validation and test splits train_dir = os.path.join(base_dir, 'train') os.mkdir(train_dir) validation_dir = os.path.join(base_dir, 'validation') os.mkdir(validation_dir) test_dir = os.path.join(base_dir, 'test') os.mkdir(test_dir) # Directory with our training smile pictures train_smile_dir = os.path.join(train_dir, 'smile') os.mkdir(train_smile_dir) # Directory with our training nosmile pictures train_nosmile_dir = os.path.join(train_dir, 'nosmile') os.mkdir(train_nosmile_dir) # Directory with our validation smile pictures validation_smile_dir = os.path.join(validation_dir, 'smile') os.mkdir(validation_smile_dir) # Directory with our validation nosmile pictures validation_nosmile_dir = os.path.join(validation_dir, 'nosmile') os.mkdir(validation_nosmile_dir) # Directory with our validation smile pictures test_smile_dir = os.path.join(test_dir, 'smile') os.mkdir(test_smile_dir) # Directory with our validation nosmile pictures test_nosmile_dir = os.path.join(test_dir, 'nosmile') os.mkdir(test_nosmile_dir)
3、將笑臉圖片和非笑臉圖片放入對應(yīng)文件夾
在上面程序中生成了一個名為smile_and_nosmile的文件夾,里面有三個子文件,分別存放訓(xùn)練、測試、驗(yàn)證數(shù)據(jù),在這三個文件夾下還有smile和nosmile文件夾,我們需要將笑臉圖片放入smile文件夾,將非笑臉圖片放入nosmile文件夾。
3、打印每個數(shù)據(jù)集文件中的笑臉和非笑臉圖片數(shù)
print('total training smile images:', len(os.listdir(train_smile_dir))) print('total training nosmile images:', len(os.listdir(train_nosmile_dir))) print('total validation smile images:', len(os.listdir(validation_smile_dir))) print('total validation nosmile images:', len(os.listdir(validation_nosmile_dir))) print('total test smile images:', len(os.listdir(test_smile_dir))) print('total test nosmile images:', len(os.listdir(test_nosmile_dir)))
4、構(gòu)建小型卷積網(wǎng)絡(luò)
我們已經(jīng)為MNIST構(gòu)建了一個小型卷積網(wǎng),所以您應(yīng)該熟悉它們。我們將重用相同的通用結(jié)構(gòu):我們的卷積網(wǎng)將是一個交替的Conv2D(激活relu)和MaxPooling2D層的堆棧。然而,由于我們處理的是更大的圖像和更復(fù)雜的問題,因此我們將使我們的網(wǎng)絡(luò)相應(yīng)地更大:它將有一個更多的Conv2D + MaxPooling2D階段。這樣既可以擴(kuò)大網(wǎng)絡(luò)的容量,又可以進(jìn)一步縮小特征圖的大小,這樣當(dāng)我們到達(dá)平坦層時,特征圖就不會太大。在這里,由于我們從大小為150x150的輸入開始(有點(diǎn)隨意的選擇),我們在Flatten層之前得到大小為7x7的feature map。
注意:feature map的深度在網(wǎng)絡(luò)中逐漸增加(從32到128),而feature map的大小在減少(從148x148到7x7)。這是你會在幾乎所有convnets中看到的模式。由于我們解決的是一個二元分類問題,我們用一個單一單元(一個大小為1的稠密層)和一個s型激活來結(jié)束網(wǎng)絡(luò)。這個單元將對網(wǎng)絡(luò)正在查看一個類或另一個類的概率進(jìn)行編碼。
from keras import layers from keras import models model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Flatten()) model.add(layers.Dense(512, activation='relu')) model.add(layers.Dense(1, activation='sigmoid'))
讓我們來看看要素地圖的尺寸是如何隨每個連續(xù)圖層而變化的
model.summary()
讓我們來看看特征地圖的尺寸是如何隨著每一個連續(xù)的層:為我們編譯步驟,我們將一如既往地使用RMSprop優(yōu)化器。由于我們用一個單一的乙狀結(jié)腸單元結(jié)束我們的網(wǎng)絡(luò),我們將使用二進(jìn)制交叉熵作為我們的損失
from keras import optimizers model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=1e-4), metrics=['acc'])
5、數(shù)據(jù)預(yù)處理
在將數(shù)據(jù)輸入到我們的網(wǎng)絡(luò)之前,應(yīng)該將數(shù)據(jù)格式化為經(jīng)過適當(dāng)預(yù)處理的浮點(diǎn)張量。目前,我們的數(shù)據(jù)以JPEG文件的形式保存在硬盤上,因此將其導(dǎo)入網(wǎng)絡(luò)的步驟大致如下:
- 讀取圖片文件
- 解碼JPEG內(nèi)容到RBG像素網(wǎng)格
- 把它們轉(zhuǎn)換成浮點(diǎn)張量
- 將像素值(從0到255)縮放到[0,1]區(qū)間
from keras.preprocessing.image import ImageDataGenerator # All images will be rescaled by 1./255 train_datagen = ImageDataGenerator(rescale=1./255) test_datagen = ImageDataGenerator(rescale=1./255) train_generator = train_datagen.flow_from_directory( # This is the target directory train_dir, # All images will be resized to 150x150 target_size=(150, 150), batch_size=20, # Since we use binary_crossentropy loss, we need binary labels class_mode='binary') validation_generator = test_datagen.flow_from_directory( validation_dir, target_size=(150, 150), batch_size=20, class_mode='binary')
讓我們看看其中一個生成器的輸出:它生成150×150 RGB圖像的批次(Shape(20,150,150,3))和二進(jìn)制標(biāo)簽(Shape(20,))。20是每批樣品的數(shù)量(批次大小)。注意,生成器無限期地生成這些批:它只是無休止地循環(huán)目標(biāo)文件夾中的圖像。因此,我們需要在某個點(diǎn)中斷迭代循環(huán)。
for data_batch, labels_batch in train_generator: print('data batch shape:', data_batch.shape) print('labels batch shape:', labels_batch.shape) break
使用生成器使我們的模型適合于數(shù)據(jù)
history = model.fit_generator( train_generator, steps_per_epoch=100, epochs=30, validation_data=validation_generator, validation_steps=50)
這里使用fit_generator方法來完成此操作,對于我們這樣的數(shù)據(jù)生成器,它相當(dāng)于fit方法。它期望Python生成器作為第一個參數(shù),它將無限期地生成成批的輸入和目標(biāo),就像我們的示例一樣。因?yàn)閿?shù)據(jù)是不斷生成的,所以在宣告一個紀(jì)元結(jié)束之前,生成器需要知道示例從生成器中抽取多少樣本。這就是steps_per_epoch參數(shù)的作用:在從生成器中繪制完steps_per_epoch批處理之后,即在運(yùn)行完steps_per_epoch梯度下降步驟之后,擬合過程將轉(zhuǎn)到下一個epoch。在我們的例子中,批次是20個樣本大,所以在我們看到2000個樣本的目標(biāo)之前將需要100個批次。
在使用fit_generator時,可以傳遞validation_data參數(shù),就像fit方法一樣。重要的是,允許這個參數(shù)本身是一個數(shù)據(jù)生成器,但是它也可以是Numpy數(shù)組的元組。如果您傳遞一個生成器作為validation_data,那么這個生成器將會不斷生成成批的驗(yàn)證數(shù)據(jù),因此您還應(yīng)該指定validation_steps參數(shù),它告訴流程從驗(yàn)證生成器提取多少批來進(jìn)行評估。
保存模型
model.save('C:\\Users\\asus\\Desktop\\test\\smile_and_nosmile.h5')
在訓(xùn)練和驗(yàn)證數(shù)據(jù)上繪制模型的損失和準(zhǔn)確性
import matplotlib.pyplot as plt acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(len(acc)) plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()
這些圖具有過擬合的特點(diǎn)。我們的訓(xùn)練精度隨著時間線性增長,直到接近100%,而我們的驗(yàn)證精度停留在70-72%。我們的驗(yàn)證損失在5個epoch后達(dá)到最小,然后停止,而訓(xùn)練損失繼續(xù)線性下降,直到接近0。
6、數(shù)據(jù)增強(qiáng)
過度擬合是由于可供學(xué)習(xí)的樣本太少,使我們無法訓(xùn)練一個模型來泛化到新的數(shù)據(jù)。給定無限的數(shù)據(jù),我們的模型將暴露于手頭數(shù)據(jù)分布的每一個可能方面:我們永遠(yuǎn)不會過度擬合。數(shù)據(jù)增強(qiáng)采用的方法是從現(xiàn)有的訓(xùn)練樣本中生成更多的訓(xùn)練數(shù)據(jù),方法是通過一系列隨機(jī)變換來“增強(qiáng)”樣本,從而產(chǎn)生看上去可信的圖像。我們的目標(biāo)是在訓(xùn)練時,我們的模型不會兩次看到完全相同的圖像。這有助于將模型暴露于數(shù)據(jù)的更多方面,并更好地泛化。
datagen = ImageDataGenerator( rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True, fill_mode='nearest')
- rotation_range是一個角度值(0-180),在這個范圍內(nèi)可以隨機(jī)旋轉(zhuǎn)圖片
- width_shift和height_shift是范圍(作為總寬度或高度的一部分),在其中可以隨機(jī)地垂直或水平地轉(zhuǎn)換圖片
- shear_range用于隨機(jī)應(yīng)用剪切轉(zhuǎn)換
- zoom_range用于在圖片內(nèi)部隨機(jī)縮放
- horizontal_flip是用于水平隨機(jī)翻轉(zhuǎn)一半的圖像——當(dāng)沒有假設(shè)水平不對稱時(例如真實(shí)世界的圖片)
- fill_mode是用于填充新創(chuàng)建像素的策略,它可以在旋轉(zhuǎn)或?qū)挾?高度移動之后出現(xiàn)。
查看增強(qiáng)后的圖像
# This is module with image preprocessing utilities from keras.preprocessing import image fnames = [os.path.join(train_smile_dir, fname) for fname in os.listdir(train_smile_dir)] # We pick one image to "augment" img_path = fnames[3] # Read the image and resize it img = image.load_img(img_path, target_size=(150, 150)) # Convert it to a Numpy array with shape (150, 150, 3) x = image.img_to_array(img) # Reshape it to (1, 150, 150, 3) x = x.reshape((1,) + x.shape) # The .flow() command below generates batches of randomly transformed images. # It will loop indefinitely, so we need to `break` the loop at some point! i = 0 for batch in datagen.flow(x, batch_size=1): plt.figure(i) imgplot = plt.imshow(image.array_to_img(batch[0])) i += 1 if i % 4 == 0: break plt.show()
如果我們使用這種數(shù)據(jù)增加配置訓(xùn)練一個新的網(wǎng)絡(luò),我們的網(wǎng)絡(luò)將永遠(yuǎn)不會看到兩次相同的輸入。然而,它看到的輸入仍然是高度相關(guān)的,因?yàn)樗鼈儊碜陨倭康脑紙D像——我們不能產(chǎn)生新的信息,我們只能混合現(xiàn)有的信息。因此,這可能還不足以完全消除過度擬合。
為了進(jìn)一步對抗過擬合,我們還將在我們的模型中增加一個Dropout層,就在密集連接分類器之前:
model = models.Sequential() model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(150, 150, 3))) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(64, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Conv2D(128, (3, 3), activation='relu')) model.add(layers.MaxPooling2D((2, 2))) model.add(layers.Flatten()) model.add(layers.Dropout(0.5)) model.add(layers.Dense(512, activation='relu')) model.add(layers.Dense(1, activation='sigmoid')) model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=1e-4), metrics=['acc'])
用數(shù)據(jù)增強(qiáng)和退出來訓(xùn)練我們的網(wǎng)絡(luò):
train_datagen = ImageDataGenerator( rescale=1./255, rotation_range=40, width_shift_range=0.2, height_shift_range=0.2, shear_range=0.2, zoom_range=0.2, horizontal_flip=True,) # Note that the validation data should not be augmented! test_datagen = ImageDataGenerator(rescale=1./255) train_generator = train_datagen.flow_from_directory( # This is the target directory train_dir, # All images will be resized to 150x150 target_size=(150, 150), batch_size=32, # Since we use binary_crossentropy loss, we need binary labels class_mode='binary') validation_generator = test_datagen.flow_from_directory( validation_dir, target_size=(150, 150), batch_size=32, class_mode='binary') history = model.fit_generator( train_generator, steps_per_epoch=100, epochs=100, validation_data=validation_generator, validation_steps=50)
這里程序會跑很久,我跑了幾個小時,用GPU跑會快很多很多。
保存模型在convnet可視化部分使用:
model.save('C:\\Users\\asus\\Desktop\\test\\smile_and_nosmile_1.h5')
再看一次結(jié)果
acc = history.history['acc'] val_acc = history.history['val_acc'] loss = history.history['loss'] val_loss = history.history['val_loss'] epochs = range(len(acc)) plt.plot(epochs, acc, 'bo', label='Training acc') plt.plot(epochs, val_acc, 'b', label='Validation acc') plt.title('Training and validation accuracy') plt.legend() plt.figure() plt.plot(epochs, loss, 'bo', label='Training loss') plt.plot(epochs, val_loss, 'b', label='Validation loss') plt.title('Training and validation loss') plt.legend() plt.show()
由于數(shù)據(jù)的增加和遺漏,我們不再過度擬合:訓(xùn)練曲線相當(dāng)緊密地跟蹤驗(yàn)證曲線。我們現(xiàn)在能夠達(dá)到82%的精度,相對于非正則化模型有15%的改進(jìn)。通過進(jìn)一步利用正則化技術(shù)和調(diào)整網(wǎng)絡(luò)參數(shù)(比如每個卷積層的濾波器數(shù)量,或者網(wǎng)絡(luò)中的層數(shù)),我們可能能夠獲得更好的精度,可能達(dá)到86-87%。
7、優(yōu)化提高笑臉圖像分類模型精度
構(gòu)建卷積網(wǎng)絡(luò)
from keras import layers from keras import models from keras import optimizers model = models.Sequential() #輸入圖片大小是150*150 3表示圖片像素用(R,G,B)表示 model.add(layers.Conv2D(32, (3,3), activation='relu', input_shape=(150 , 150, 3))) model.add(layers.MaxPooling2D((2,2))) model.add(layers.Conv2D(64, (3,3), activation='relu')) model.add(layers.MaxPooling2D((2,2))) model.add(layers.Conv2D(128, (3,3), activation='relu')) model.add(layers.MaxPooling2D((2,2))) model.add(layers.Conv2D(128, (3,3), activation='relu')) model.add(layers.MaxPooling2D((2,2))) model.add(layers.Flatten()) model.add(layers.Dense(512, activation='relu')) model.add(layers.Dense(1, activation='sigmoid')) model.compile(loss='binary_crossentropy', optimizer=optimizers.RMSprop(lr=1e-4), metrics=['acc']) model.summary()
(三)圖片笑臉檢測
# 單張圖片進(jìn)行判斷 是笑臉還是非笑臉 import cv2 from keras.preprocessing import image from keras.models import load_model import numpy as np model = load_model('smile_and_nosmile_1.h5') img_path='C:\\Users\\asus\\Desktop\\test\\genki4k\\file2227.jpg' img = image.load_img(img_path, target_size=(150, 150)) #img1 = cv2.imread(img_path,cv2.IMREAD_GRAYSCALE) #cv2.imshow('wname',img1) #cv2.waitKey(0) #print(img.size) img_tensor = image.img_to_array(img)/255.0 img_tensor = np.expand_dims(img_tensor, axis=0) prediction =model.predict(img_tensor) print(prediction) if prediction[0][0]>0.5: result='smile' else: result='nosmile' print(result)
結(jié)果正確,錯誤率在0.0883181左右,反復(fù)找圖片嘗試,結(jié)果都是正確的。
(四)實(shí)時視頻笑臉檢測
import cv2 from keras.preprocessing import image from keras.models import load_model import numpy as np import dlib from PIL import Image model = load_model('smile_and_nosmile_1.h5') detector = dlib.get_frontal_face_detector() video=cv2.VideoCapture(0) font = cv2.FONT_HERSHEY_SIMPLEX def rec(img): gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) dets=detector(gray,1) if dets is not None: for face in dets: left=face.left() top=face.top() right=face.right() bottom=face.bottom() cv2.rectangle(img,(left,top),(right,bottom),(0,255,0),2) img1=cv2.resize(img[top:bottom,left:right],dsize=(150,150)) img1=cv2.cvtColor(img1,cv2.COLOR_BGR2RGB) img1 = np.array(img1)/255. img_tensor = img1.reshape(-1,150,150,3) prediction =model.predict(img_tensor) print(prediction) if prediction[0][0]<0.5: result='nosmile' else: result='smile' cv2.putText(img, result, (left,top), font, 2, (0, 255, 0), 2, cv2.LINE_AA) cv2.imshow('smile detector', img) while video.isOpened(): res, img_rd = video.read() if not res: break rec(img_rd) if cv2.waitKey(1) & 0xFF == ord('q'): break video.release() cv2.destroyAllWindows()
視頻檢測正確,就是背景太黑了…
三、將笑臉數(shù)據(jù)集換成人臉口罩?jǐn)?shù)據(jù)集,并對口罩?jǐn)?shù)據(jù)集進(jìn)行訓(xùn)練,編寫程序?qū)崿F(xiàn)人臉口罩檢測
(一)訓(xùn)練人臉口罩?jǐn)?shù)據(jù)集
人臉口罩?jǐn)?shù)據(jù)集下載鏈接:
http://xiazai.jb51.net/202108/yuanma/mask_jb51.rar
訓(xùn)練人臉口罩?jǐn)?shù)據(jù)集和訓(xùn)練笑臉數(shù)據(jù)集一樣,只需改一下和相應(yīng)的變量名和數(shù)據(jù)集。
(二)編程實(shí)現(xiàn)人臉口罩檢測
import cv2 from keras.preprocessing import image from keras.models import load_model import numpy as np import dlib from PIL import Image model = load_model('mask_and_nomask.h5') detector = dlib.get_frontal_face_detector() video=cv2.VideoCapture(0) font = cv2.FONT_HERSHEY_SIMPLEX def rec(img): gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) dets=detector(gray,1) if dets is not None: for face in dets: left=face.left() top=face.top() right=face.right() bottom=face.bottom() cv2.rectangle(img,(left,top),(right,bottom),(0,255,0),2) img1=cv2.resize(img[top:bottom,left:right],dsize=(150,150)) img1=cv2.cvtColor(img1,cv2.COLOR_BGR2RGB) img1 = np.array(img1)/255. img_tensor = img1.reshape(-1,150,150,3) prediction =model.predict(img_tensor) print(prediction) if prediction[0][0]>0.5: result='nomask' else: result='mask' cv2.putText(img, result, (left,top), font, 2, (0, 255, 0), 2, cv2.LINE_AA) cv2.imshow('mask detector', img) while video.isOpened(): res, img_rd = video.read() if not res: break rec(img_rd) if cv2.waitKey(1) & 0xFF == ord('q'): break video.release() cv2.destroyAllWindows()
運(yùn)行結(jié)果:
不戴口罩
戴口罩
人臉口罩檢測正確!
雖然人臉口罩檢測正確,但是精度還是不高,因?yàn)槲业臄?shù)據(jù)集里面戴口罩得的圖像太少了,朋友們可以多找一些戴口罩的圖片以提高精度,后續(xù)我也會不斷完善~
到此這篇關(guān)于Python實(shí)現(xiàn)笑臉檢測+人臉口罩檢測的文章就介紹到這了,更多相關(guān)Python人臉口罩檢測內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Python利用pdfplumber實(shí)現(xiàn)讀取PDF寫入Excel
pdfplumber專注PDF內(nèi)容提取,例如文本(位置、字體及顏色等)和形狀(矩形、直線、曲線),還有解析表格的功能。本文主要為大家介紹如何利用pdfplumber實(shí)現(xiàn)讀取PDF寫入Excel,需要的可以參考一下2022-06-06python3格式化字符串 f-string的高級用法(推薦)
從Python 3.6開始,f-string是格式化字符串的一種很好的新方法。與其他格式化方式相比,它們不僅更易讀,更簡潔,不易出錯,而且速度更快!本文重點(diǎn)給大家介紹python3格式化字符串 f-string的高級用法,一起看看吧2020-03-03python實(shí)現(xiàn)簡單點(diǎn)對點(diǎn)(p2p)聊天
這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)簡單點(diǎn)對點(diǎn)p2p聊天,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-09-09pandas數(shù)據(jù)篩選和csv操作的實(shí)現(xiàn)方法
這篇文章主要介紹了pandas數(shù)據(jù)篩選和csv操作的實(shí)現(xiàn)方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-07-07python 檢查數(shù)據(jù)中是否有缺失值,刪除缺失值的方式
今天小編就為大家分享一篇python 檢查數(shù)據(jù)中是否有缺失值,刪除缺失值的方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-12-12淺談python中統(tǒng)計計數(shù)的幾種方法和Counter詳解
今天小編就為大家分享一篇淺談python中統(tǒng)計計數(shù)的幾種方法和Counter詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2019-11-11一篇文章從零開始創(chuàng)建conda環(huán)境、常用命令的使用及pycharm配置項(xiàng)目環(huán)境
在Conda中創(chuàng)建新環(huán)境是一個非常有用的做法,尤其是當(dāng)你需要為不同的項(xiàng)目安裝不同版本的軟件包時,這篇文章主要給大家介紹了關(guān)于從零開始創(chuàng)建conda環(huán)境、常用命令的使用及pycharm配置項(xiàng)目環(huán)境的相關(guān)資料,需要的朋友可以參考下2024-07-07python檢測lvs real server狀態(tài)
這篇文章主要介紹了用python檢測lvs real server狀態(tài)的示例,大家參考使用吧2014-01-01