自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

拿下抖音小姐姐,我寫了個(gè)口紅色號(hào)識(shí)別器!

開發(fā) 前端
對于廣大“鋼鐵直男”的程序員來說,送什么禮物給女朋友一直是個(gè)世紀(jì)難題。

 對于廣大“鋼鐵直男”的程序員來說,送什么禮物給女朋友一直是個(gè)世紀(jì)難題。

[[277501]]

圖片來自 Pexels

其實(shí)哄女朋友開心最深的套路就是花式送口紅,就問誰抵擋得住啊啊啊啊......

“沒有什么問題是一支口紅解決不了的,如果有,那就兩支。”于是,直男們紛紛開始各種買口紅、送口紅……

畢竟李佳琦一句"OMG買它”,女朋友披頭散發(fā)搶購,錢包就空了一半。

[[277502]] 

但是,口紅色號(hào)千千萬,選對了牌子才成功了一半。

快樂橙、傷心紫,姨媽紅,雞屎綠…直男眼里沒什么區(qū)別的顏色,在女生眼里各種色調(diào)、質(zhì)地細(xì)微的區(qū)別都能分析一清二楚。

[[277503]] 

那么,對于直男來說,怎么才能搞清楚如此多的口紅色號(hào)呢?

我耗費(fèi)一毫米發(fā)際線,琢磨了一下,做出了一個(gè)口紅色號(hào)識(shí)別器,希望能幫大家在關(guān)鍵時(shí)刻把深刻的革命友誼再升華一下。

先來看看效果。讓我們假設(shè),小姐姐發(fā)來了一張美妝博主的美照,并暗示你,“人家也喜歡這個(gè)顏色。”

[[277504]] 

圖片來自網(wǎng)絡(luò)

這個(gè)時(shí)候,用我們的口紅色號(hào)識(shí)別器,就能定位嘴唇,并迅速給出它的顏色隸屬哪家品牌的哪個(gè)色號(hào)。

OMG!簡直比李佳琦還準(zhǔn)確!

[[277505]] 

好啦,廢話不多說,馬上開始教學(xué)時(shí)間!

來自 Github 的口紅色號(hào)宇宙

要想識(shí)別口紅色號(hào),先得讓機(jī)器知道到底都有哪些顏色。

聽柜姐介紹,紅色系有:“草莓紅、鐵銹紅、楓葉紅...”,其他還有“豆沙色、吃土色、番茄色...”

[[277506]]

世界觀還未建立完全就要開始土崩瓦解,這看著有區(qū)別嗎?“豆沙色最為百搭,橘調(diào)的番茄色比較顯白...”眼前的黑不是黑,你說的紅是什么紅?

[[277507]] 

還好,在萬能的 Github 上找到了一個(gè)寶藏?cái)?shù)據(jù)庫“口紅顏色可視化”,這個(gè)數(shù)據(jù)庫堪比口紅的色號(hào)宇宙,不僅囊括了當(dāng)前最主流品牌的各種系列色號(hào),還很良心的在色盤上排列了出來。

這個(gè)數(shù)據(jù)集是一個(gè)嵌套的字典數(shù)據(jù)結(jié)構(gòu),存為 json 串的形式,里面記錄了每個(gè)口紅品牌系列下不同口紅色號(hào)的顏色 id、名稱、和 16 進(jìn)制顏色值。

直!男!救!星!有木有!

口紅色號(hào)可視化鏈接:

  1. https://github.com/Ovilia/lipstick 

不過看著這密密麻麻的顏色,真心佩服各大口紅品牌的文案高手,是怎么樣區(qū)別每一個(gè)看不出區(qū)別的顏色,并且還要分別取名字的。

 

傻傻分不清的我對 5 個(gè)品牌的不同系列做了一下統(tǒng)計(jì)和色號(hào)錄入,于是,剩下的就交給計(jì)算機(jī)啦。

先用番茄做個(gè)實(shí)驗(yàn)?

既然有了如此完備的色號(hào)數(shù)據(jù)庫,那么文摘菌就有了一個(gè)討巧的方法:要想找到合適的色號(hào),可以直接截取顏色,然后在數(shù)據(jù)庫中進(jìn)行比對。

這個(gè)方法非常好操作,在上唇色之前,我們不如先拿別的紅色物品來練手。

比如,這里有一只番茄圖片,你看這個(gè)番茄它又大又圓:

在其中截取了成色均勻、無高亮的矩形圖片: 

提取這張純色圖片的 RGB 值在技術(shù)上是可行的,getcolor.py 代碼如下:

  1. import colorsys 
  2. import PIL.Image as Image 
  3.  
  4. def get_dominant_color(image): 
  5.     max_score = 0.0001 
  6.     dominant_color = None 
  7.     for count,(r,g,b) in image.getcolors(image.size[0]*image.size[1]): 
  8.         # 轉(zhuǎn)為HSV標(biāo)準(zhǔn) 
  9.         saturation = colorsys.rgb_to_hsv(r/255.0, g/255.0, b/255.0)[1] 
  10.         y = min(abs(r*2104+g*4130+b*802+4096+131072)>>13,235) 
  11.         y = (y-16.0)/(235-16) 
  12.  
  13.         #忽略高亮色 
  14.         if y > 0.9: 
  15.             continue 
  16.         score = (saturation+0.1)*count 
  17.         if score > max_score: 
  18.             max_score = score 
  19.             dominant_color = (r,g,b) 
  20.     return dominant_color 

為了減少誤差,需要裁剪多個(gè)不同位置的圖片,保存在本地的一個(gè)文件夾中,讀取文件,提取顏色,求平均值,得到的番茄最終的 RGB 顏色,代碼如下:

  1. import os 
  2. import getcolor 
  3. from os.path import join as pjoin 
  4. from scipy import misc 
  5.  
  6. def load_color(color_dir,list):  
  7.     count = 0 
  8.     for dir in os.listdir(color_dir):   
  9.         img_dir = pjoin(color_dir, dir)   
  10.         image = getcolor.Image.open(img_dir) 
  11.         image = image.convert('RGB'
  12.         get=getcolor.get_dominant_color(image) 
  13.         list.append(get) 
  14.         count = count+1 
  15.         #print(person_dir) 
  16.     #print(count
  17.     return count 
  18.  
  19. def Mean_color(count,list): 
  20.      Mean_R=Mean_G=Mean_B=0 
  21.      for i in range(count): 
  22.         tuple=list[i] 
  23.         Mean_R+=tuple[0] 
  24.         Mean_G+=tuple[1] 
  25.         Mean_B+=tuple[2] 
  26.      MeanC=((int)(Mean_R/count),(int)(Mean_G/count),(int)(Mean_B/count)) 
  27.      return Me 

番茄的顏色提取到了,那么和什么做比對呢?

當(dāng)然是口紅的數(shù)據(jù),文摘菌這兒用到了 5 個(gè)品牌,分別是圣羅蘭、香奈兒可可小姐、迪奧、美寶蓮、紀(jì)梵希,共 17 個(gè)系列,271 個(gè)口紅色號(hào)。

數(shù)據(jù)集是一個(gè)嵌套的字典數(shù)據(jù)結(jié)構(gòu),存為 json 串的形式,里面記錄了每個(gè)口紅品牌系列下不同口紅色號(hào)的顏色 id、名稱、和 16 進(jìn)制顏色值。

lipstick.json部分?jǐn)?shù)據(jù)集展示如下:

  1. {"brands":[{"name":"圣羅蘭","series"
  2. [{"name":"瑩亮純魅唇膏","lipsticks"
  3. [{"color":"#D62352","id":"49","name":"撩騷"}, 
  4. {"color":"#DC4B41","id":"14","name":"一見傾心"}, 
  5. {"color":"#B22146","id":"05","name":"浮生若夢"}, 

數(shù)據(jù)集中存儲(chǔ)的 RGB 顏色是 16 進(jìn)制的字符串形式,需要將其轉(zhuǎn)換成 RGB 值,比較兩個(gè)顏色相近與否。

實(shí)際上是比較 RGB 三個(gè)分量維度上的誤差,最小的口紅輸出對應(yīng)的品牌、系列、色號(hào)和 id。

代碼如下:

  1. import json 
  2. import getcolor 
  3. import numpy as np 
  4. import lipcolor 
  5.  
  6. #filename = 'temp.txt' 
  7. ##write the temp data to file## 
  8. def WtoFile(filename,RGB_temp): 
  9.     num=len(RGB_temp) 
  10.     with open(filename,'w'as f:  
  11.        for i in range(num): 
  12.            s = str(RGB_temp[i]).replace('[','').replace(']',''
  13.            f.write(s) 
  14.            f.write("\n"
  15.  
  16. #operate the data # 
  17. ##save the brand&series&color id&color name to sum_list## 
  18. ##covert the color #D62352 to RGB_array## 
  19. ##caculate the RGB difference to RGB_temp and write the value to file## 
  20. def data_operate(): 
  21.     with open('lipstick.json''r', encoding='utf-8'as f: 
  22.       ret_dic = json.load(f) 
  23.       #print(ret_dic['brands']) 
  24.       #print(type(ret_dic)) # <class 'dict'
  25.       #print(ret_dic['brands'][0]['name'])  
  26.       b_num=len(ret_dic['brands']) 
  27.       #print(b_num)#brands number 
  28.  
  29.       s_list=[] 
  30.       #series brands# 
  31.       for i in range(len(ret_dic['brands'])): 
  32.           s_num=len(ret_dic['brands'][i]['series']) 
  33.           s_list.append(s_num) 
  34.           #print("{0} has {1} series".format((ret_dic['brands'][i]['name']),(s_list[i]))) 
  35.  
  36.  
  37.       #the lipstick color of every brands every series# 
  38.       #the first loop calculate the total color numbers 
  39.       sum=0 
  40.       for b1 in range(b_num): 
  41.           for s1 in range(s_list[b1]): 
  42.               brand_name=ret_dic['brands'][b1]['name'
  43.               lip_name=ret_dic['brands'][b1]['series'][s1]['name'
  44.               color_num=len(ret_dic['brands'][b1]['series'][s1]['lipsticks']) 
  45.               sum+=color_num#calculate the total color numbers 
  46.  
  47.       #the second loop save the message to a list# 
  48.       sum_list=np.zeros((sum,4), dtype=(str,8)) 
  49.       value_array=np.zeros((sum,6), dtype=int
  50.       i=0     
  51.       for b2 in range(b_num): 
  52.           for s2 in range(s_list[b2]): 
  53.               brand_name=ret_dic['brands'][b2]['name'
  54.               #print(type(brand_name)) 
  55.               lip_name=ret_dic['brands'][b2]['series'][s2]['name'
  56.               color_num=len(ret_dic['brands'][b2]['series'][s2]['lipsticks']) 
  57.               for c in range(color_num): 
  58.                     color_value=ret_dic['brands'][b2]['series'][s2]['lipsticks'][c]['color'
  59.                     color_name=ret_dic['brands'][b2]['series'][s2]['lipsticks'][c]['name'
  60.                     color_id=ret_dic['brands'][b2]['series'][s2]['lipsticks'][c]['id'
  61.                     #print("{0} series {1} has {2} colors,color {3}:{4}".format(brand_name,lip_name,color_num,c+1,color_name)) 
  62.                     sum_list[i][0]=brand_name 
  63.                     sum_list[i][1]=lip_name 
  64.                     sum_list[i][2]=color_id 
  65.                     sum_list[i][3]=color_name 
  66.                     #value_array[i]=value_array[i][1] 
  67.                     #convert "#D62352" to [13  6  2  3  5  2]# 
  68.                     for l in range(6): 
  69.                         temp=color_value[l+1] 
  70.                         if(temp>='A'and temp<='F'): 
  71.                            temp1=ord(temp)-ord('A')+10 
  72.                         else
  73.                            temp1=ord(temp)-ord('0'
  74.                         value_array[i][l]=temp1 
  75.                     i+=1 
  76.  
  77.  
  78.     #the third loop covert value_array to RGB_array# 
  79.       RGB_array=np.zeros((sum,3), dtype=int
  80.       for i in range(sum): 
  81.           RGB_array[i][0]=value_array[i][0]*16+value_array[i][1] 
  82.           RGB_array[i][1]=value_array[i][2]*16+value_array[i][3] 
  83.           RGB_array[i][2]=value_array[i][4]*16+value_array[i][5] 
  84.  
  85.       #calculate the similar and save to RGB_temp 
  86.       #RGB_temp=np.zeros((sum,1), dtype=int
  87.       RGB_temp=np.zeros((sum,1), dtype=float
  88.       for i in range(sum): 
  89.           R=RGB_array[i][0] 
  90.           G=RGB_array[i][1] 
  91.           B=RGB_array[i][2] 
  92.           RGB_temp[i]=abs(get[0]-R)+abs(get[1]*3/4-G)+abs(get[2]-B) 
  93.       RGB_temp.tolist();#covert array to list 
  94.       #print(RGB_temp) 
  95.       filename="temp.txt" 
  96.       WtoFile(filename,RGB_temp) 
  97.       #sort the RGB_temp# 
  98.       result=sorted(range(len(RGB_temp)), key=lambda k: RGB_temp[k]) 
  99.       #print(result) 
  100.       #output the three max prob of the lipsticks# 
  101.       print("The first three possible lipstick brand and color id&name are as follows:"
  102.       for i in range(3): 
  103.           idex=result[i] 
  104.           print(sum_list[idex]) 
  105.       print("The first three possible lipstick brand RGB value are as follows:"
  106.       for i in range(3): 
  107.           idex=result[i] 
  108.           R=RGB_array[idex][0] 
  109.           G=RGB_array[idex][1] 
  110.           B=RGB_array[idex][2] 
  111.           tuple=(R,G,B) 
  112.           print(tuple) 
  113.  
  114.  
  115. if __name__ == '__main__'
  116.      #image = getcolor.Image.open(inputpath) 
  117.      #image = image.convert('RGB'
  118.      #get=getcolor.get_dominant_color(image)#tuple #get=(231, 213, 211) 
  119.      list=[] 
  120.      color_dir="output" 
  121.      count=lipcolor.load_color(color_dir,list) 
  122.      get=lipcolor.Mean_color(count,list) 
  123.      print("the extracted RGB value of the color is {0}".format(get)) 
  124.      #operate the data# 
  125.      data_operat 

輸出最有可能吻合番茄顏色的前三個(gè)口紅的信息,然后在 Spyder 中的運(yùn)行結(jié)果:

 

可以看到最有可能的三個(gè)口紅品牌色號(hào)的 RGB 值與番茄的 RGB 值是非常接近的。

提取到的番茄顏色:

'迪奧' '烈艷藍(lán)金唇膏' '080' '微笑正紅’的顏色: 

'圣羅蘭' '純口紅' '56' '橙紅織錦'的顏色: 

'紀(jì)梵希' '高定香榭天鵝絨唇' '325' '圣水紅'的顏色: 

我已經(jīng)眼花繚亂,三個(gè)顏色……有區(qū)別嗎?!以后不如準(zhǔn)備統(tǒng)一叫它們,番茄色! 

[[277514]] 

不過,這也正說明了,剛剛的提取&對比方法可行!

既然可以識(shí)別番茄的顏色,那么,可以識(shí)別人像中的口紅色號(hào)嗎?

進(jìn)入正題!人像口紅色號(hào)識(shí)別

接下來,我們需要做的是輸入一張人像圖片,可以自動(dòng)識(shí)別其中的嘴唇區(qū)域,并提取出嘴唇區(qū)域中的一部分做為顏色提取的源圖像。

這里就要用到 CV 的人臉識(shí)別了,還好 Dlib 庫又幫助我們減輕一大部分的工作量。

Dlib 中有自帶的 68 個(gè)人臉的識(shí)別器,可以得到人臉部位包括眉毛、眼睛、鼻梁、面部輪廓和嘴唇區(qū)域的具體點(diǎn)的位置,到這兒,我以為很輕松就可以截到嘴唇區(qū)域了,結(jié)果有點(diǎn)尷尬.........

我們首先找到了一張小姐姐的照片:

截取到的嘴唇區(qū)域如下:

很明顯的看到上下嘴唇黑色的區(qū)域也截取到了,這對后續(xù)的提色有影響,所以不得不回到最初的 68 個(gè)檢測點(diǎn)來思考人生。

 

圣羅蘭官網(wǎng) #842C71 口紅

標(biāo)記的 68 個(gè)人臉檢測點(diǎn)如上圖所示,而嘴唇部位是從第 49 個(gè)標(biāo)記點(diǎn)開始的(數(shù)組的話,下標(biāo)是 48)。

為了盡可能的截取到均勻成色的嘴唇片段,剛開始是想從第 50 個(gè)標(biāo)記點(diǎn)對角線截取到第 56 個(gè)標(biāo)記點(diǎn),而這不可避免的會(huì)截取到上下嘴唇之間的縫隙,這兒的陰影也會(huì)影響后續(xù)的顏色提取準(zhǔn)確度。

考慮到下嘴唇比上嘴唇寬,所以截取到下嘴唇中間的兩個(gè)小正方形區(qū)域:

 

人臉識(shí)別和截取嘴唇區(qū)域的代碼如下:

  1. import numpy as np  
  2. import cv2 
  3. import dlib 
  4. from PIL import Image 
  5.  
  6. def crop(source,pos): 
  7.  
  8.       x1=pos[2][0] 
  9.       y1=pos[2][1] 
  10.       x2=pos[1][0] 
  11.       y2=pos[1][1] 
  12.       d=abs(x2-x1) 
  13.       region = source[(int)(y1-d*0.75):y2,x1:x2] 
  14.       # save the image 
  15.       cv2.imwrite("output/Mouth1.jpg", region) 
  16.  
  17.       x1=pos[1][0] 
  18.       y1=pos[1][1] 
  19.       x2=pos[0][0] 
  20.       y2=pos[0][1] 
  21.       d=abs(x1-x2) 
  22.       region = source[y1-d:y2,x1:x2] 
  23.       # save the image 
  24.       cv2.imwrite("output/Mouth2.jpg", region) 
  25.  
  26.  
  27. def detect_mouth(img,pos): 
  28.         gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 
  29.         gray = cv2.equalizeHist(gray) 
  30.         detector = dlib.get_frontal_face_detector() 
  31.         #use the predictor  
  32.         predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat'
  33.         dets = detector(img, 1)    
  34.         print("Number of faces detected: {}".format(len(dets))) 
  35.         for a in dets:     
  36.            cv2.rectangle(img,(a.left(),a.top()),(a.right(),a.bottom()),(255,0,0)) 
  37.         #point_list=[]#save the mouth point to point_list[]# 
  38.         #Extract 68 feature points of the face and crop the lip image# 
  39.         for index, face in enumerate(dets): 
  40.            print('face {}; left {}; top {}; right {}; bottom {}'.format(index, face.left(), face.top(), face.right(), face.bottom())) 
  41.            shape = predictor(gray, face) 
  42.            for i, pt in enumerate(shape.parts()): 
  43.             #print('Part {}: {}'.format(i, pt)) 
  44.             #print(i) 
  45.              pt_pos = (pt.x, pt.y) 
  46.              if i>=48 and i<=67: 
  47.                 cv2.circle(img, pt_pos, 2, (255, 0, 0), 1) 
  48.              if i>=56 and i<=58: 
  49.                 #print(pt_pos) 
  50.                 pos[i-56][0]=pt.x 
  51.                 pos[i-56][1]=pt.y 
  52.              #cv2.circle(img, pt_pos, 2, (255, 0, 0), 1) 
  53.         return img 
  54.  
  55. if __name__ == "__main__":  
  56.       img = cv2.imread("test3.png"
  57.       #copy the input image for the later crop# 
  58.       img_clone = np.copy(img) 
  59.       cv2.imwrite("input/source.jpg",img_clone) 
  60.       #save the lip position to pos array# 
  61.       pos=np.zeros((3,2), dtype=int
  62.       result=detect_mouth(img,pos) 
  63.       cv2.imwrite("input/source2.jpg",result) 
  64.       #crop the lip areas# 
  65.       source = cv2.imread("input/source.jpg"
  66.       crop(source,pos) 
  67.       # show the result 
  68.       cv2.imshow('FaceDetect',result) 
  69.       cv2.waitKey(0)  
  70.       cv2.destroyAllWindow 

既然已經(jīng)截取到嘴唇的小矩形圖像了,接下來的工作就和前面一樣了,在數(shù)據(jù)庫中對比每個(gè) RGB 值輸出最小誤差對應(yīng)的口紅信息,而這兒也有難到我。

單純的比對 RGB 分量對口紅色號(hào)來說并不適用,有可能每個(gè)分量相差很小,而疊加起來的顏色和提取到的顏色并不相似,在顏色的比對上需要手動(dòng)調(diào)參。

幾經(jīng)波折,最后輸出的結(jié)果還是可以接受的,上圖人像中涂的口紅色號(hào),感興趣的讀者可以查下正好是下面輸出排名第一的口紅信息。

誤差分析

對于我們測試的圖片信息,標(biāo)記了嘴唇區(qū)域的特征點(diǎn),我們提取到的 RGB 值(156,59,103)顏色如下所示:

可以看到和圖片的顏色已經(jīng)十分接近了,而數(shù)據(jù)集合 lipstick.json 中這種口紅存儲(chǔ)的 16 進(jìn)制顏色值為 #842C71,對應(yīng)的顏色如下:

明顯看到數(shù)據(jù)集存儲(chǔ)的顏色和實(shí)際照片的顏色是有些許誤差的,而在本文算法實(shí)現(xiàn)過程中,又不可避免的有以下誤差:

  • 嘴唇區(qū)域截取不可避免會(huì)截取到皮膚中的一部分顏色,雖然算法已經(jīng)將那種可能降到最低。
  • 顏色提取上,雖然截取多個(gè)嘴唇圖片求平均值,但是本身的提取算法還是和實(shí)際值稍有偏差。
  • RGB 顏色相似度比對的算法也不夠精確。
  • 最最重要的是,照片必須是原圖,而且光線要自然,加了濾鏡的圖是怎么也不可能識(shí)別出來的。

以上種種,使得讓計(jì)算機(jī)快速高效地識(shí)別不同的口紅色號(hào)還是有困難的,原來計(jì)算機(jī)有時(shí)候也會(huì)很直男。

實(shí)時(shí)人像口紅色號(hào)預(yù)測

看到這兒,可能很多讀者朋友想實(shí)時(shí)地試一下能不能讓計(jì)算機(jī)判斷自己的口紅色號(hào),這對于 OpenCV 這一強(qiáng)大的圖形操作庫來說,不是什么問題。

它可以打開你的攝像頭,讀取每一幀的圖片,結(jié)合前文提到的人臉識(shí)別代碼,可以實(shí)時(shí)地截取到嘴唇區(qū)域的圖片,然后交給計(jì)算機(jī)預(yù)測,從此再也不怕女朋友的靈魂拷問!

[[277523]]

最后,附上打開攝像頭的代碼,快叫女朋友過來試下吧!

  1. #coding=utf8 
  2. import cv2 
  3. import time 
  4. print('Press Esc to exit'
  5. imgWindow = cv2.namedWindow('FaceDetect', cv2.WINDOW_NORMAL) 
  6. import sys 
  7. import os 
  8. import dlib 
  9. import glob 
  10. import numpy 
  11. from skimage import io 
  12. def detect_face(): 
  13.     capInput = cv2.VideoCapture(0) 
  14.     #nextCaptureTime = time.time() 
  15.     faces = [] 
  16.     feas = []  
  17.     if not capInput.isOpened(): print('Capture failed because of camera'
  18.     while 1: 
  19.         ret, img = capInput.read() 
  20.         gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) 
  21.         gray = cv2.equalizeHist(gray) 
  22.         time=0 
  23.         eTime = time.time() + 0.1 
  24.         detector = dlib.get_frontal_face_detector()  
  25.         predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat'
  26.         dets = detector(gray, 1)   
  27.         print("Number of faces detected: {}".format(len(dets))) 
  28.         for a in dets:     
  29.            cv2.rectangle(img,(a.left(),a.top()),(a.right(),a.bottom()),(255,0,0)) 
  30.         for index, face in enumerate(dets): 
  31.            print('face {}; left {}; top {}; right {}; bottom {}'.format(index, face.left(), face.top(), face.right(), face.bottom())) 
  32.            shape = predictor(gray, face)    
  33.            for i, pt in enumerate(shape.parts()): 
  34.             #print('Part {}: {}'.format(i, pt)) 
  35.              pt_pos = (pt.x, pt.y) 
  36.              cv2.circle(img, pt_pos, 2, (255, 0, 0), 1) 
  37.         cv2.imshow('FaceDetect',img) 
  38.         if cv2.waitKey(1) & 0xFF == 27: break 
  39.     capInput.release() 
  40.     cv2.destroyAllWindows() 
  41. if __name__ == "__main__":  
  42.     detect_face() 

好啦,佳期如夢,雙星良夜,在一個(gè)充滿愛意的日子里,定位好女神常用的口紅色號(hào),和那個(gè)她來場華麗的邂逅吧!

福利來啦

來給大家送一波福利,包郵送 6 本 Python 技術(shù)書籍,參與方式很簡單,關(guān)注51CTO技術(shù)棧公眾號(hào),在公眾號(hào)后臺(tái)回復(fù)「抽獎(jiǎng)」,彈出小程序后點(diǎn)擊參與。 

開獎(jiǎng)時(shí)間是 9 月 25 日 20:00 ,一定要留意微信消息,如果你中獎(jiǎng)了就盡快微信聯(lián)系我,告訴我想要的書和快遞信息。一天之內(nèi)沒有回復(fù),送書名額就轉(zhuǎn)給其他人了。

 

責(zé)任編輯:武曉燕 來源: 大數(shù)據(jù)文摘
相關(guān)推薦

2021-04-14 14:28:14

Python點(diǎn)攢抖音

2020-04-07 12:13:15

Python數(shù)據(jù)爬蟲

2019-11-11 17:42:02

前端開發(fā)編程

2019-06-21 09:55:10

刷抖美腿App

2019-10-21 10:01:58

Python素描技術(shù)

2023-12-03 08:36:33

AI模型

2020-05-26 10:20:56

Python開發(fā)工具

2020-09-29 09:09:03

數(shù)據(jù)庫程序運(yùn)行

2021-06-28 05:19:32

抖音電腦

2022-06-06 12:19:08

抖音功耗優(yōu)化Android 應(yīng)用

2021-10-25 20:02:00

gRPC訂閱模式超時(shí)控制

2021-10-05 21:03:54

BeautifulSo 爬蟲

2018-02-05 15:52:06

硬盤故障損壞

2023-07-07 08:24:53

Python爬蟲Flask

2017-11-10 14:12:35

2022-01-22 07:44:12

抖音PC 版電腦刷抖音

2019-03-07 15:04:37

抖音快手同城

2023-12-05 13:49:00

AI模型

2022-02-23 14:21:20

Chrome插件瀏覽器

2024-06-13 17:10:16

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)