欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

TensorFlow車(chē)牌識(shí)別完整版代碼(含車(chē)牌數(shù)據(jù)集)

 更新時(shí)間:2019年08月05日 11:29:17   作者:ShadowN1ght  
這篇文章主要介紹了TensorFlow車(chē)牌識(shí)別完整版代碼(含車(chē)牌數(shù)據(jù)集),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧

在之前發(fā)布的一篇博文《MNIST數(shù)據(jù)集實(shí)現(xiàn)車(chē)牌識(shí)別--初步演示版》中,我們演示了如何使用TensorFlow進(jìn)行車(chē)牌識(shí)別,但是,當(dāng)時(shí)采用的數(shù)據(jù)集是MNIST數(shù)字手寫(xiě)體,只能分類(lèi)0-9共10個(gè)數(shù)字,無(wú)法分類(lèi)省份簡(jiǎn)稱(chēng)和字母,局限性較大,無(wú)實(shí)際意義。

經(jīng)過(guò)圖像定位分割處理,博主收集了相關(guān)省份簡(jiǎn)稱(chēng)和26個(gè)字母的圖片數(shù)據(jù)集,結(jié)合前述博文中貼出的python+TensorFlow代碼,實(shí)現(xiàn)了完整的車(chē)牌識(shí)別功能。本著分享精神,在此送上全部代碼和車(chē)牌數(shù)據(jù)集。

車(chē)牌數(shù)據(jù)集下載地址(約4000張圖片):tf_car_license_dataset_jb51.rar

省份簡(jiǎn)稱(chēng)訓(xùn)練+識(shí)別代碼(保存文件名為train-license-province.py)(拷貝代碼請(qǐng)務(wù)必注意python文本縮進(jìn),只要有一處縮進(jìn)錯(cuò)誤,就無(wú)法得到正確結(jié)果,或者出現(xiàn)異常):

#!/usr/bin/python3.5
# -*- coding: utf-8 -*- 
 
import sys
import os
import time
import random
 
import numpy as np
import tensorflow as tf
 
from PIL import Image
 
 
SIZE = 1280
WIDTH = 32
HEIGHT = 40
NUM_CLASSES = 6
iterations = 300
 
SAVER_DIR = "train-saver/province/"
 
PROVINCES = ("京","閩","粵","蘇","滬","浙")
nProvinceIndex = 0
 
time_begin = time.time()
 
 
# 定義輸入節(jié)點(diǎn),對(duì)應(yīng)于圖片像素值矩陣集合和圖片標(biāo)簽(即所代表的數(shù)字)
x = tf.placeholder(tf.float32, shape=[None, SIZE])
y_ = tf.placeholder(tf.float32, shape=[None, NUM_CLASSES])
 
x_image = tf.reshape(x, [-1, WIDTH, HEIGHT, 1])
 
 
# 定義卷積函數(shù)
def conv_layer(inputs, W, b, conv_strides, kernel_size, pool_strides, padding):
  L1_conv = tf.nn.conv2d(inputs, W, strides=conv_strides, padding=padding)
  L1_relu = tf.nn.relu(L1_conv + b)
  return tf.nn.max_pool(L1_relu, ksize=kernel_size, strides=pool_strides, padding='SAME')
 
# 定義全連接層函數(shù)
def full_connect(inputs, W, b):
  return tf.nn.relu(tf.matmul(inputs, W) + b)
 
 
if __name__ =='__main__' and sys.argv[1]=='train':
  # 第一次遍歷圖片目錄是為了獲取圖片總數(shù)
  input_count = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/training-set/chinese-characters/%s/' % i      # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        input_count += 1
 
  # 定義對(duì)應(yīng)維數(shù)和各維長(zhǎng)度的數(shù)組
  input_images = np.array([[0]*SIZE for i in range(input_count)])
  input_labels = np.array([[0]*NUM_CLASSES for i in range(input_count)])
 
  # 第二次遍歷圖片目錄是為了生成圖片數(shù)據(jù)和標(biāo)簽
  index = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/training-set/chinese-characters/%s/' % i     # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        filename = dir + filename
        img = Image.open(filename)
        width = img.size[0]
        height = img.size[1]
        for h in range(0, height):
          for w in range(0, width):
            # 通過(guò)這樣的處理,使數(shù)字的線條變細(xì),有利于提高識(shí)別準(zhǔn)確率
            if img.getpixel((w, h)) > 230:
              input_images[index][w+h*width] = 0
            else:
              input_images[index][w+h*width] = 1
        input_labels[index][i] = 1
        index += 1
 
  # 第一次遍歷圖片目錄是為了獲取圖片總數(shù)
  val_count = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/validation-set/chinese-characters/%s/' % i      # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        val_count += 1
 
  # 定義對(duì)應(yīng)維數(shù)和各維長(zhǎng)度的數(shù)組
  val_images = np.array([[0]*SIZE for i in range(val_count)])
  val_labels = np.array([[0]*NUM_CLASSES for i in range(val_count)])
 
  # 第二次遍歷圖片目錄是為了生成圖片數(shù)據(jù)和標(biāo)簽
  index = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/validation-set/chinese-characters/%s/' % i     # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        filename = dir + filename
        img = Image.open(filename)
        width = img.size[0]
        height = img.size[1]
        for h in range(0, height):
          for w in range(0, width):
            # 通過(guò)這樣的處理,使數(shù)字的線條變細(xì),有利于提高識(shí)別準(zhǔn)確率
            if img.getpixel((w, h)) > 230:
              val_images[index][w+h*width] = 0
            else:
              val_images[index][w+h*width] = 1
        val_labels[index][i] = 1
        index += 1
  
  with tf.Session() as sess:
    # 第一個(gè)卷積層
    W_conv1 = tf.Variable(tf.truncated_normal([8, 8, 1, 16], stddev=0.1), name="W_conv1")
    b_conv1 = tf.Variable(tf.constant(0.1, shape=[16]), name="b_conv1")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 2, 2, 1]
    pool_strides = [1, 2, 2, 1]
    L1_pool = conv_layer(x_image, W_conv1, b_conv1, conv_strides, kernel_size, pool_strides, padding='SAME')
 
    # 第二個(gè)卷積層
    W_conv2 = tf.Variable(tf.truncated_normal([5, 5, 16, 32], stddev=0.1), name="W_conv2")
    b_conv2 = tf.Variable(tf.constant(0.1, shape=[32]), name="b_conv2")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 1, 1, 1]
    pool_strides = [1, 1, 1, 1]
    L2_pool = conv_layer(L1_pool, W_conv2, b_conv2, conv_strides, kernel_size, pool_strides, padding='SAME')
 
 
    # 全連接層
    W_fc1 = tf.Variable(tf.truncated_normal([16 * 20 * 32, 512], stddev=0.1), name="W_fc1")
    b_fc1 = tf.Variable(tf.constant(0.1, shape=[512]), name="b_fc1")
    h_pool2_flat = tf.reshape(L2_pool, [-1, 16 * 20*32])
    h_fc1 = full_connect(h_pool2_flat, W_fc1, b_fc1)
 
 
    # dropout
    keep_prob = tf.placeholder(tf.float32)
 
    h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
 
 
    # readout層
    W_fc2 = tf.Variable(tf.truncated_normal([512, NUM_CLASSES], stddev=0.1), name="W_fc2")
    b_fc2 = tf.Variable(tf.constant(0.1, shape=[NUM_CLASSES]), name="b_fc2")
 
    # 定義優(yōu)化器和訓(xùn)練op
    y_conv = tf.matmul(h_fc1_drop, W_fc2) + b_fc2
    cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=y_conv))
    train_step = tf.train.AdamOptimizer((1e-4)).minimize(cross_entropy)
 
    correct_prediction = tf.equal(tf.argmax(y_conv, 1), tf.argmax(y_, 1))
    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
 
    # 初始化saver
    saver = tf.train.Saver()
 
    sess.run(tf.global_variables_initializer())
 
    time_elapsed = time.time() - time_begin
    print("讀取圖片文件耗費(fèi)時(shí)間:%d秒" % time_elapsed)
    time_begin = time.time()
 
    print ("一共讀取了 %s 個(gè)訓(xùn)練圖像, %s 個(gè)標(biāo)簽" % (input_count, input_count))
 
    # 設(shè)置每次訓(xùn)練op的輸入個(gè)數(shù)和迭代次數(shù),這里為了支持任意圖片總數(shù),定義了一個(gè)余數(shù)remainder,譬如,如果每次訓(xùn)練op的輸入個(gè)數(shù)為60,圖片總數(shù)為150張,則前面兩次各輸入60張,最后一次輸入30張(余數(shù)30)
    batch_size = 60
    iterations = iterations
    batches_count = int(input_count / batch_size)
    remainder = input_count % batch_size
    print ("訓(xùn)練數(shù)據(jù)集分成 %s 批, 前面每批 %s 個(gè)數(shù)據(jù),最后一批 %s 個(gè)數(shù)據(jù)" % (batches_count+1, batch_size, remainder))
 
    # 執(zhí)行訓(xùn)練迭代
    for it in range(iterations):
      # 這里的關(guān)鍵是要把輸入數(shù)組轉(zhuǎn)為np.array
      for n in range(batches_count):
        train_step.run(feed_dict={x: input_images[n*batch_size:(n+1)*batch_size], y_: input_labels[n*batch_size:(n+1)*batch_size], keep_prob: 0.5})
      if remainder > 0:
        start_index = batches_count * batch_size;
        train_step.run(feed_dict={x: input_images[start_index:input_count-1], y_: input_labels[start_index:input_count-1], keep_prob: 0.5})
 
      # 每完成五次迭代,判斷準(zhǔn)確度是否已達(dá)到100%,達(dá)到則退出迭代循環(huán)
      iterate_accuracy = 0
      if it%5 == 0:
        iterate_accuracy = accuracy.eval(feed_dict={x: val_images, y_: val_labels, keep_prob: 1.0})
        print ('第 %d 次訓(xùn)練迭代: 準(zhǔn)確率 %0.5f%%' % (it, iterate_accuracy*100))
        if iterate_accuracy >= 0.9999 and it >= 150:
          break;
 
    print ('完成訓(xùn)練!')
    time_elapsed = time.time() - time_begin
    print ("訓(xùn)練耗費(fèi)時(shí)間:%d秒" % time_elapsed)
    time_begin = time.time()
 
    # 保存訓(xùn)練結(jié)果
    if not os.path.exists(SAVER_DIR):
      print ('不存在訓(xùn)練數(shù)據(jù)保存目錄,現(xiàn)在創(chuàng)建保存目錄')
      os.makedirs(SAVER_DIR)
    saver_path = saver.save(sess, "%smodel.ckpt"%(SAVER_DIR))
 
 
 
if __name__ =='__main__' and sys.argv[1]=='predict':
  saver = tf.train.import_meta_graph("%smodel.ckpt.meta"%(SAVER_DIR))
  with tf.Session() as sess:
    model_file=tf.train.latest_checkpoint(SAVER_DIR)
    saver.restore(sess, model_file)
 
    # 第一個(gè)卷積層
    W_conv1 = sess.graph.get_tensor_by_name("W_conv1:0")
    b_conv1 = sess.graph.get_tensor_by_name("b_conv1:0")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 2, 2, 1]
    pool_strides = [1, 2, 2, 1]
    L1_pool = conv_layer(x_image, W_conv1, b_conv1, conv_strides, kernel_size, pool_strides, padding='SAME')
 
    # 第二個(gè)卷積層
    W_conv2 = sess.graph.get_tensor_by_name("W_conv2:0")
    b_conv2 = sess.graph.get_tensor_by_name("b_conv2:0")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 1, 1, 1]
    pool_strides = [1, 1, 1, 1]
    L2_pool = conv_layer(L1_pool, W_conv2, b_conv2, conv_strides, kernel_size, pool_strides, padding='SAME')
 
 
    # 全連接層
    W_fc1 = sess.graph.get_tensor_by_name("W_fc1:0")
    b_fc1 = sess.graph.get_tensor_by_name("b_fc1:0")
    h_pool2_flat = tf.reshape(L2_pool, [-1, 16 * 20*32])
    h_fc1 = full_connect(h_pool2_flat, W_fc1, b_fc1)
 
 
    # dropout
    keep_prob = tf.placeholder(tf.float32)
 
    h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
 
 
    # readout層
    W_fc2 = sess.graph.get_tensor_by_name("W_fc2:0")
    b_fc2 = sess.graph.get_tensor_by_name("b_fc2:0")
 
    # 定義優(yōu)化器和訓(xùn)練op
    conv = tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)
 
    for n in range(1,2):
      path = "test_images/%s.bmp" % (n)
      img = Image.open(path)
      width = img.size[0]
      height = img.size[1]
 
      img_data = [[0]*SIZE for i in range(1)]
      for h in range(0, height):
        for w in range(0, width):
          if img.getpixel((w, h)) < 190:
            img_data[0][w+h*width] = 1
          else:
            img_data[0][w+h*width] = 0
      
      result = sess.run(conv, feed_dict = {x: np.array(img_data), keep_prob: 1.0})
      max1 = 0
      max2 = 0
      max3 = 0
      max1_index = 0
      max2_index = 0
      max3_index = 0
      for j in range(NUM_CLASSES):
        if result[0][j] > max1:
          max1 = result[0][j]
          max1_index = j
          continue
        if (result[0][j]>max2) and (result[0][j]<=max1):
          max2 = result[0][j]
          max2_index = j
          continue
        if (result[0][j]>max3) and (result[0][j]<=max2):
          max3 = result[0][j]
          max3_index = j
          continue
      
      nProvinceIndex = max1_index
      print ("概率: [%s %0.2f%%]  [%s %0.2f%%]  [%s %0.2f%%]" % (PROVINCES[max1_index],max1*100, PROVINCES[max2_index],max2*100, PROVINCES[max3_index],max3*100))
      
    print ("省份簡(jiǎn)稱(chēng)是: %s" % PROVINCES[nProvinceIndex])

城市代號(hào)訓(xùn)練+識(shí)別代碼(保存文件名為train-license-letters.py):

#!/usr/bin/python3.5
# -*- coding: utf-8 -*- 
 
import sys
import os
import time
import random
 
import numpy as np
import tensorflow as tf
 
from PIL import Image
 
 
SIZE = 1280
WIDTH = 32
HEIGHT = 40
NUM_CLASSES = 26
iterations = 500
 
SAVER_DIR = "train-saver/letters/"
 
LETTERS_DIGITS = ("A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X","Y","Z","I","O")
license_num = ""
 
time_begin = time.time()
 
 
# 定義輸入節(jié)點(diǎn),對(duì)應(yīng)于圖片像素值矩陣集合和圖片標(biāo)簽(即所代表的數(shù)字)
x = tf.placeholder(tf.float32, shape=[None, SIZE])
y_ = tf.placeholder(tf.float32, shape=[None, NUM_CLASSES])
 
x_image = tf.reshape(x, [-1, WIDTH, HEIGHT, 1])
 
 
# 定義卷積函數(shù)
def conv_layer(inputs, W, b, conv_strides, kernel_size, pool_strides, padding):
  L1_conv = tf.nn.conv2d(inputs, W, strides=conv_strides, padding=padding)
  L1_relu = tf.nn.relu(L1_conv + b)
  return tf.nn.max_pool(L1_relu, ksize=kernel_size, strides=pool_strides, padding='SAME')
 
# 定義全連接層函數(shù)
def full_connect(inputs, W, b):
  return tf.nn.relu(tf.matmul(inputs, W) + b)
 
 
if __name__ =='__main__' and sys.argv[1]=='train':
  # 第一次遍歷圖片目錄是為了獲取圖片總數(shù)
  input_count = 0
  for i in range(0+10,NUM_CLASSES+10):
    dir = './train_images/training-set/letters/%s/' % i      # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        input_count += 1
 
  # 定義對(duì)應(yīng)維數(shù)和各維長(zhǎng)度的數(shù)組
  input_images = np.array([[0]*SIZE for i in range(input_count)])
  input_labels = np.array([[0]*NUM_CLASSES for i in range(input_count)])
 
  # 第二次遍歷圖片目錄是為了生成圖片數(shù)據(jù)和標(biāo)簽
  index = 0
  for i in range(0+10,NUM_CLASSES+10):
    dir = './train_images/training-set/letters/%s/' % i     # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        filename = dir + filename
        img = Image.open(filename)
        width = img.size[0]
        height = img.size[1]
        for h in range(0, height):
          for w in range(0, width):
            # 通過(guò)這樣的處理,使數(shù)字的線條變細(xì),有利于提高識(shí)別準(zhǔn)確率
            if img.getpixel((w, h)) > 230:
              input_images[index][w+h*width] = 0
            else:
              input_images[index][w+h*width] = 1
        #print ("i=%d, index=%d" % (i, index))
        input_labels[index][i-10] = 1
        index += 1
 
  # 第一次遍歷圖片目錄是為了獲取圖片總數(shù)
  val_count = 0
  for i in range(0+10,NUM_CLASSES+10):
    dir = './train_images/validation-set/%s/' % i      # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        val_count += 1
 
  # 定義對(duì)應(yīng)維數(shù)和各維長(zhǎng)度的數(shù)組
  val_images = np.array([[0]*SIZE for i in range(val_count)])
  val_labels = np.array([[0]*NUM_CLASSES for i in range(val_count)])
 
  # 第二次遍歷圖片目錄是為了生成圖片數(shù)據(jù)和標(biāo)簽
  index = 0
  for i in range(0+10,NUM_CLASSES+10):
    dir = './train_images/validation-set/%s/' % i     # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        filename = dir + filename
        img = Image.open(filename)
        width = img.size[0]
        height = img.size[1]
        for h in range(0, height):
          for w in range(0, width):
            # 通過(guò)這樣的處理,使數(shù)字的線條變細(xì),有利于提高識(shí)別準(zhǔn)確率
            if img.getpixel((w, h)) > 230:
              val_images[index][w+h*width] = 0
            else:
              val_images[index][w+h*width] = 1
        val_labels[index][i-10] = 1
        index += 1
  
  with tf.Session() as sess:
    # 第一個(gè)卷積層
    W_conv1 = tf.Variable(tf.truncated_normal([8, 8, 1, 16], stddev=0.1), name="W_conv1")
    b_conv1 = tf.Variable(tf.constant(0.1, shape=[16]), name="b_conv1")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 2, 2, 1]
    pool_strides = [1, 2, 2, 1]
    L1_pool = conv_layer(x_image, W_conv1, b_conv1, conv_strides, kernel_size, pool_strides, padding='SAME')
 
    # 第二個(gè)卷積層
    W_conv2 = tf.Variable(tf.truncated_normal([5, 5, 16, 32], stddev=0.1), name="W_conv2")
    b_conv2 = tf.Variable(tf.constant(0.1, shape=[32]), name="b_conv2")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 1, 1, 1]
    pool_strides = [1, 1, 1, 1]
    L2_pool = conv_layer(L1_pool, W_conv2, b_conv2, conv_strides, kernel_size, pool_strides, padding='SAME')
 
 
    # 全連接層
    W_fc1 = tf.Variable(tf.truncated_normal([16 * 20 * 32, 512], stddev=0.1), name="W_fc1")
    b_fc1 = tf.Variable(tf.constant(0.1, shape=[512]), name="b_fc1")
    h_pool2_flat = tf.reshape(L2_pool, [-1, 16 * 20*32])
    h_fc1 = full_connect(h_pool2_flat, W_fc1, b_fc1)
 
 
    # dropout
    keep_prob = tf.placeholder(tf.float32)
 
    h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
 
 
    # readout層
    W_fc2 = tf.Variable(tf.truncated_normal([512, NUM_CLASSES], stddev=0.1), name="W_fc2")
    b_fc2 = tf.Variable(tf.constant(0.1, shape=[NUM_CLASSES]), name="b_fc2")
 
    # 定義優(yōu)化器和訓(xùn)練op
    y_conv = tf.matmul(h_fc1_drop, W_fc2) + b_fc2
    cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=y_conv))
    train_step = tf.train.AdamOptimizer((1e-4)).minimize(cross_entropy)
 
    correct_prediction = tf.equal(tf.argmax(y_conv, 1), tf.argmax(y_, 1))
    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
 
    sess.run(tf.global_variables_initializer())
 
    time_elapsed = time.time() - time_begin
    print("讀取圖片文件耗費(fèi)時(shí)間:%d秒" % time_elapsed)
    time_begin = time.time()
 
    print ("一共讀取了 %s 個(gè)訓(xùn)練圖像, %s 個(gè)標(biāo)簽" % (input_count, input_count))
 
    # 設(shè)置每次訓(xùn)練op的輸入個(gè)數(shù)和迭代次數(shù),這里為了支持任意圖片總數(shù),定義了一個(gè)余數(shù)remainder,譬如,如果每次訓(xùn)練op的輸入個(gè)數(shù)為60,圖片總數(shù)為150張,則前面兩次各輸入60張,最后一次輸入30張(余數(shù)30)
    batch_size = 60
    iterations = iterations
    batches_count = int(input_count / batch_size)
    remainder = input_count % batch_size
    print ("訓(xùn)練數(shù)據(jù)集分成 %s 批, 前面每批 %s 個(gè)數(shù)據(jù),最后一批 %s 個(gè)數(shù)據(jù)" % (batches_count+1, batch_size, remainder))
 
    # 執(zhí)行訓(xùn)練迭代
    for it in range(iterations):
      # 這里的關(guān)鍵是要把輸入數(shù)組轉(zhuǎn)為np.array
      for n in range(batches_count):
        train_step.run(feed_dict={x: input_images[n*batch_size:(n+1)*batch_size], y_: input_labels[n*batch_size:(n+1)*batch_size], keep_prob: 0.5})
      if remainder > 0:
        start_index = batches_count * batch_size;
        train_step.run(feed_dict={x: input_images[start_index:input_count-1], y_: input_labels[start_index:input_count-1], keep_prob: 0.5})
 
      # 每完成五次迭代,判斷準(zhǔn)確度是否已達(dá)到100%,達(dá)到則退出迭代循環(huán)
      iterate_accuracy = 0
      if it%5 == 0:
        iterate_accuracy = accuracy.eval(feed_dict={x: val_images, y_: val_labels, keep_prob: 1.0})
        print ('第 %d 次訓(xùn)練迭代: 準(zhǔn)確率 %0.5f%%' % (it, iterate_accuracy*100))
        if iterate_accuracy >= 0.9999 and it >= iterations:
          break;
 
    print ('完成訓(xùn)練!')
    time_elapsed = time.time() - time_begin
    print ("訓(xùn)練耗費(fèi)時(shí)間:%d秒" % time_elapsed)
    time_begin = time.time()
 
    # 保存訓(xùn)練結(jié)果
    if not os.path.exists(SAVER_DIR):
      print ('不存在訓(xùn)練數(shù)據(jù)保存目錄,現(xiàn)在創(chuàng)建保存目錄')
      os.makedirs(SAVER_DIR)
    # 初始化saver
    saver = tf.train.Saver()      
    saver_path = saver.save(sess, "%smodel.ckpt"%(SAVER_DIR))
 
 
 
if __name__ =='__main__' and sys.argv[1]=='predict':
  saver = tf.train.import_meta_graph("%smodel.ckpt.meta"%(SAVER_DIR))
  with tf.Session() as sess:
    model_file=tf.train.latest_checkpoint(SAVER_DIR)
    saver.restore(sess, model_file)
 
    # 第一個(gè)卷積層
    W_conv1 = sess.graph.get_tensor_by_name("W_conv1:0")
    b_conv1 = sess.graph.get_tensor_by_name("b_conv1:0")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 2, 2, 1]
    pool_strides = [1, 2, 2, 1]
    L1_pool = conv_layer(x_image, W_conv1, b_conv1, conv_strides, kernel_size, pool_strides, padding='SAME')
 
    # 第二個(gè)卷積層
    W_conv2 = sess.graph.get_tensor_by_name("W_conv2:0")
    b_conv2 = sess.graph.get_tensor_by_name("b_conv2:0")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 1, 1, 1]
    pool_strides = [1, 1, 1, 1]
    L2_pool = conv_layer(L1_pool, W_conv2, b_conv2, conv_strides, kernel_size, pool_strides, padding='SAME')
 
 
    # 全連接層
    W_fc1 = sess.graph.get_tensor_by_name("W_fc1:0")
    b_fc1 = sess.graph.get_tensor_by_name("b_fc1:0")
    h_pool2_flat = tf.reshape(L2_pool, [-1, 16 * 20*32])
    h_fc1 = full_connect(h_pool2_flat, W_fc1, b_fc1)
 
 
    # dropout
    keep_prob = tf.placeholder(tf.float32)
 
    h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
 
 
    # readout層
    W_fc2 = sess.graph.get_tensor_by_name("W_fc2:0")
    b_fc2 = sess.graph.get_tensor_by_name("b_fc2:0")
 
    # 定義優(yōu)化器和訓(xùn)練op
    conv = tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)
 
    for n in range(2,3):
      path = "test_images/%s.bmp" % (n)
      img = Image.open(path)
      width = img.size[0]
      height = img.size[1]
 
      img_data = [[0]*SIZE for i in range(1)]
      for h in range(0, height):
        for w in range(0, width):
          if img.getpixel((w, h)) < 190:
            img_data[0][w+h*width] = 1
          else:
            img_data[0][w+h*width] = 0
      
      result = sess.run(conv, feed_dict = {x: np.array(img_data), keep_prob: 1.0})
      
      max1 = 0
      max2 = 0
      max3 = 0
      max1_index = 0
      max2_index = 0
      max3_index = 0
      for j in range(NUM_CLASSES):
        if result[0][j] > max1:
          max1 = result[0][j]
          max1_index = j
          continue
        if (result[0][j]>max2) and (result[0][j]<=max1):
          max2 = result[0][j]
          max2_index = j
          continue
        if (result[0][j]>max3) and (result[0][j]<=max2):
          max3 = result[0][j]
          max3_index = j
          continue
      
      if n == 3:
        license_num += "-"
      license_num = license_num + LETTERS_DIGITS[max1_index]
      print ("概率: [%s %0.2f%%]  [%s %0.2f%%]  [%s %0.2f%%]" % (LETTERS_DIGITS[max1_index],max1*100, LETTERS_DIGITS[max2_index],max2*100, LETTERS_DIGITS[max3_index],max3*100))
      
    print ("城市代號(hào)是: 【%s】" % license_num)

車(chē)牌編號(hào)訓(xùn)練+識(shí)別代碼(保存文件名為train-license-digits.py):

#!/usr/bin/python3.5
# -*- coding: utf-8 -*- 
 
import sys
import os
import time
import random
 
import numpy as np
import tensorflow as tf
 
from PIL import Image
 
 
SIZE = 1280
WIDTH = 32
HEIGHT = 40
NUM_CLASSES = 34
iterations = 1000
 
SAVER_DIR = "train-saver/digits/"
 
LETTERS_DIGITS = ("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","J","K","L","M","N","P","Q","R","S","T","U","V","W","X","Y","Z")
license_num = ""
 
time_begin = time.time()
 
 
# 定義輸入節(jié)點(diǎn),對(duì)應(yīng)于圖片像素值矩陣集合和圖片標(biāo)簽(即所代表的數(shù)字)
x = tf.placeholder(tf.float32, shape=[None, SIZE])
y_ = tf.placeholder(tf.float32, shape=[None, NUM_CLASSES])
 
x_image = tf.reshape(x, [-1, WIDTH, HEIGHT, 1])
 
 
# 定義卷積函數(shù)
def conv_layer(inputs, W, b, conv_strides, kernel_size, pool_strides, padding):
  L1_conv = tf.nn.conv2d(inputs, W, strides=conv_strides, padding=padding)
  L1_relu = tf.nn.relu(L1_conv + b)
  return tf.nn.max_pool(L1_relu, ksize=kernel_size, strides=pool_strides, padding='SAME')
 
# 定義全連接層函數(shù)
def full_connect(inputs, W, b):
  return tf.nn.relu(tf.matmul(inputs, W) + b)
 
 
if __name__ =='__main__' and sys.argv[1]=='train':
  # 第一次遍歷圖片目錄是為了獲取圖片總數(shù)
  input_count = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/training-set/%s/' % i      # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        input_count += 1
 
  # 定義對(duì)應(yīng)維數(shù)和各維長(zhǎng)度的數(shù)組
  input_images = np.array([[0]*SIZE for i in range(input_count)])
  input_labels = np.array([[0]*NUM_CLASSES for i in range(input_count)])
 
  # 第二次遍歷圖片目錄是為了生成圖片數(shù)據(jù)和標(biāo)簽
  index = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/training-set/%s/' % i     # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        filename = dir + filename
        img = Image.open(filename)
        width = img.size[0]
        height = img.size[1]
        for h in range(0, height):
          for w in range(0, width):
            # 通過(guò)這樣的處理,使數(shù)字的線條變細(xì),有利于提高識(shí)別準(zhǔn)確率
            if img.getpixel((w, h)) > 230:
              input_images[index][w+h*width] = 0
            else:
              input_images[index][w+h*width] = 1
        input_labels[index][i] = 1
        index += 1
 
  # 第一次遍歷圖片目錄是為了獲取圖片總數(shù)
  val_count = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/validation-set/%s/' % i      # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        val_count += 1
 
  # 定義對(duì)應(yīng)維數(shù)和各維長(zhǎng)度的數(shù)組
  val_images = np.array([[0]*SIZE for i in range(val_count)])
  val_labels = np.array([[0]*NUM_CLASSES for i in range(val_count)])
 
  # 第二次遍歷圖片目錄是為了生成圖片數(shù)據(jù)和標(biāo)簽
  index = 0
  for i in range(0,NUM_CLASSES):
    dir = './train_images/validation-set/%s/' % i     # 這里可以改成你自己的圖片目錄,i為分類(lèi)標(biāo)簽
    for rt, dirs, files in os.walk(dir):
      for filename in files:
        filename = dir + filename
        img = Image.open(filename)
        width = img.size[0]
        height = img.size[1]
        for h in range(0, height):
          for w in range(0, width):
            # 通過(guò)這樣的處理,使數(shù)字的線條變細(xì),有利于提高識(shí)別準(zhǔn)確率
            if img.getpixel((w, h)) > 230:
              val_images[index][w+h*width] = 0
            else:
              val_images[index][w+h*width] = 1
        val_labels[index][i] = 1
        index += 1
  
  with tf.Session() as sess:
    # 第一個(gè)卷積層
    W_conv1 = tf.Variable(tf.truncated_normal([8, 8, 1, 16], stddev=0.1), name="W_conv1")
    b_conv1 = tf.Variable(tf.constant(0.1, shape=[16]), name="b_conv1")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 2, 2, 1]
    pool_strides = [1, 2, 2, 1]
    L1_pool = conv_layer(x_image, W_conv1, b_conv1, conv_strides, kernel_size, pool_strides, padding='SAME')
 
    # 第二個(gè)卷積層
    W_conv2 = tf.Variable(tf.truncated_normal([5, 5, 16, 32], stddev=0.1), name="W_conv2")
    b_conv2 = tf.Variable(tf.constant(0.1, shape=[32]), name="b_conv2")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 1, 1, 1]
    pool_strides = [1, 1, 1, 1]
    L2_pool = conv_layer(L1_pool, W_conv2, b_conv2, conv_strides, kernel_size, pool_strides, padding='SAME')
 
 
    # 全連接層
    W_fc1 = tf.Variable(tf.truncated_normal([16 * 20 * 32, 512], stddev=0.1), name="W_fc1")
    b_fc1 = tf.Variable(tf.constant(0.1, shape=[512]), name="b_fc1")
    h_pool2_flat = tf.reshape(L2_pool, [-1, 16 * 20*32])
    h_fc1 = full_connect(h_pool2_flat, W_fc1, b_fc1)
 
 
    # dropout
    keep_prob = tf.placeholder(tf.float32)
 
    h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
 
 
    # readout層
    W_fc2 = tf.Variable(tf.truncated_normal([512, NUM_CLASSES], stddev=0.1), name="W_fc2")
    b_fc2 = tf.Variable(tf.constant(0.1, shape=[NUM_CLASSES]), name="b_fc2")
 
    # 定義優(yōu)化器和訓(xùn)練op
    y_conv = tf.matmul(h_fc1_drop, W_fc2) + b_fc2
    cross_entropy = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels=y_, logits=y_conv))
    train_step = tf.train.AdamOptimizer((1e-4)).minimize(cross_entropy)
 
    correct_prediction = tf.equal(tf.argmax(y_conv, 1), tf.argmax(y_, 1))
    accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
 
    sess.run(tf.global_variables_initializer())
 
    time_elapsed = time.time() - time_begin
    print("讀取圖片文件耗費(fèi)時(shí)間:%d秒" % time_elapsed)
    time_begin = time.time()
 
    print ("一共讀取了 %s 個(gè)訓(xùn)練圖像, %s 個(gè)標(biāo)簽" % (input_count, input_count))
 
    # 設(shè)置每次訓(xùn)練op的輸入個(gè)數(shù)和迭代次數(shù),這里為了支持任意圖片總數(shù),定義了一個(gè)余數(shù)remainder,譬如,如果每次訓(xùn)練op的輸入個(gè)數(shù)為60,圖片總數(shù)為150張,則前面兩次各輸入60張,最后一次輸入30張(余數(shù)30)
    batch_size = 60
    iterations = iterations
    batches_count = int(input_count / batch_size)
    remainder = input_count % batch_size
    print ("訓(xùn)練數(shù)據(jù)集分成 %s 批, 前面每批 %s 個(gè)數(shù)據(jù),最后一批 %s 個(gè)數(shù)據(jù)" % (batches_count+1, batch_size, remainder))
 
    # 執(zhí)行訓(xùn)練迭代
    for it in range(iterations):
      # 這里的關(guān)鍵是要把輸入數(shù)組轉(zhuǎn)為np.array
      for n in range(batches_count):
        train_step.run(feed_dict={x: input_images[n*batch_size:(n+1)*batch_size], y_: input_labels[n*batch_size:(n+1)*batch_size], keep_prob: 0.5})
      if remainder > 0:
        start_index = batches_count * batch_size;
        train_step.run(feed_dict={x: input_images[start_index:input_count-1], y_: input_labels[start_index:input_count-1], keep_prob: 0.5})
 
      # 每完成五次迭代,判斷準(zhǔn)確度是否已達(dá)到100%,達(dá)到則退出迭代循環(huán)
      iterate_accuracy = 0
      if it%5 == 0:
        iterate_accuracy = accuracy.eval(feed_dict={x: val_images, y_: val_labels, keep_prob: 1.0})
        print ('第 %d 次訓(xùn)練迭代: 準(zhǔn)確率 %0.5f%%' % (it, iterate_accuracy*100))
        if iterate_accuracy >= 0.9999 and it >= iterations:
          break;
 
    print ('完成訓(xùn)練!')
    time_elapsed = time.time() - time_begin
    print ("訓(xùn)練耗費(fèi)時(shí)間:%d秒" % time_elapsed)
    time_begin = time.time()
 
    # 保存訓(xùn)練結(jié)果
    if not os.path.exists(SAVER_DIR):
      print ('不存在訓(xùn)練數(shù)據(jù)保存目錄,現(xiàn)在創(chuàng)建保存目錄')
      os.makedirs(SAVER_DIR)
    # 初始化saver
    saver = tf.train.Saver()      
    saver_path = saver.save(sess, "%smodel.ckpt"%(SAVER_DIR))
 
 
 
if __name__ =='__main__' and sys.argv[1]=='predict':
  saver = tf.train.import_meta_graph("%smodel.ckpt.meta"%(SAVER_DIR))
  with tf.Session() as sess:
    model_file=tf.train.latest_checkpoint(SAVER_DIR)
    saver.restore(sess, model_file)
 
    # 第一個(gè)卷積層
    W_conv1 = sess.graph.get_tensor_by_name("W_conv1:0")
    b_conv1 = sess.graph.get_tensor_by_name("b_conv1:0")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 2, 2, 1]
    pool_strides = [1, 2, 2, 1]
    L1_pool = conv_layer(x_image, W_conv1, b_conv1, conv_strides, kernel_size, pool_strides, padding='SAME')
 
    # 第二個(gè)卷積層
    W_conv2 = sess.graph.get_tensor_by_name("W_conv2:0")
    b_conv2 = sess.graph.get_tensor_by_name("b_conv2:0")
    conv_strides = [1, 1, 1, 1]
    kernel_size = [1, 1, 1, 1]
    pool_strides = [1, 1, 1, 1]
    L2_pool = conv_layer(L1_pool, W_conv2, b_conv2, conv_strides, kernel_size, pool_strides, padding='SAME')
 
 
    # 全連接層
    W_fc1 = sess.graph.get_tensor_by_name("W_fc1:0")
    b_fc1 = sess.graph.get_tensor_by_name("b_fc1:0")
    h_pool2_flat = tf.reshape(L2_pool, [-1, 16 * 20*32])
    h_fc1 = full_connect(h_pool2_flat, W_fc1, b_fc1)
 
 
    # dropout
    keep_prob = tf.placeholder(tf.float32)
 
    h_fc1_drop = tf.nn.dropout(h_fc1, keep_prob)
 
 
    # readout層
    W_fc2 = sess.graph.get_tensor_by_name("W_fc2:0")
    b_fc2 = sess.graph.get_tensor_by_name("b_fc2:0")
 
    # 定義優(yōu)化器和訓(xùn)練op
    conv = tf.nn.softmax(tf.matmul(h_fc1_drop, W_fc2) + b_fc2)
 
    for n in range(3,8):
      path = "test_images/%s.bmp" % (n)
      img = Image.open(path)
      width = img.size[0]
      height = img.size[1]
 
      img_data = [[0]*SIZE for i in range(1)]
      for h in range(0, height):
        for w in range(0, width):
          if img.getpixel((w, h)) < 190:
            img_data[0][w+h*width] = 1
          else:
            img_data[0][w+h*width] = 0
      
      result = sess.run(conv, feed_dict = {x: np.array(img_data), keep_prob: 1.0})
      
      max1 = 0
      max2 = 0
      max3 = 0
      max1_index = 0
      max2_index = 0
      max3_index = 0
      for j in range(NUM_CLASSES):
        if result[0][j] > max1:
          max1 = result[0][j]
          max1_index = j
          continue
        if (result[0][j]>max2) and (result[0][j]<=max1):
          max2 = result[0][j]
          max2_index = j
          continue
        if (result[0][j]>max3) and (result[0][j]<=max2):
          max3 = result[0][j]
          max3_index = j
          continue
      
      license_num = license_num + LETTERS_DIGITS[max1_index]
      print ("概率: [%s %0.2f%%]  [%s %0.2f%%]  [%s %0.2f%%]" % (LETTERS_DIGITS[max1_index],max1*100, LETTERS_DIGITS[max2_index],max2*100, LETTERS_DIGITS[max3_index],max3*100))
      
    print ("車(chē)牌編號(hào)是: 【%s】" % license_num)

保存好上面三個(gè)python腳本后,我們首先進(jìn)行省份簡(jiǎn)稱(chēng)訓(xùn)練。在運(yùn)行代碼之前,需要先把數(shù)據(jù)集解壓到訓(xùn)練腳本所在目錄。然后,在命令行中進(jìn)入腳本所在目錄,輸入執(zhí)行如下命令:

python train-license-province.py train

訓(xùn)練結(jié)果如下:


然后進(jìn)行省份簡(jiǎn)稱(chēng)識(shí)別,在命令行輸入執(zhí)行如下命令:

python train-license-province.py predict


執(zhí)行城市代號(hào)訓(xùn)練(相當(dāng)于訓(xùn)練26個(gè)字母):

python train-license-letters.py train


識(shí)別城市代號(hào):

python train-license-letters.py predict


執(zhí)行車(chē)牌編號(hào)訓(xùn)練(相當(dāng)于訓(xùn)練24個(gè)字母+10個(gè)數(shù)字,我國(guó)交通法規(guī)規(guī)定車(chē)牌編號(hào)中不包含字母I和O):

python train-license-digits.py train


識(shí)別車(chē)牌編號(hào):

python train-license-digits.py predict


可以看到,在測(cè)試圖片上,識(shí)別準(zhǔn)確率很高。識(shí)別結(jié)果是閩O-1672Q。

下圖是測(cè)試圖片的車(chē)牌原圖:


以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Python執(zhí)行遺傳編程gplearn庫(kù)使用實(shí)例探究

    Python執(zhí)行遺傳編程gplearn庫(kù)使用實(shí)例探究

    這篇文章主要為大家介紹了Python執(zhí)行遺傳編程gplearn庫(kù)使用實(shí)例探究,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2024-01-01
  • Python實(shí)現(xiàn)仿射密碼的思路詳解

    Python實(shí)現(xiàn)仿射密碼的思路詳解

    這篇文章主要介紹了Python實(shí)現(xiàn)仿射密碼的思路詳解,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-04-04
  • 解決Python找不到ssl模塊問(wèn)題 No module named _ssl的方法

    解決Python找不到ssl模塊問(wèn)題 No module named _ssl的方法

    這篇文章主要介紹了解決Python找不到ssl模塊問(wèn)題 No module named _ssl的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2019-04-04
  • Python實(shí)現(xiàn)制度轉(zhuǎn)換(貨幣,溫度,長(zhǎng)度)

    Python實(shí)現(xiàn)制度轉(zhuǎn)換(貨幣,溫度,長(zhǎng)度)

    這篇文章主要介紹了Python實(shí)現(xiàn)制度轉(zhuǎn)換(貨幣,溫度,長(zhǎng)度),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-07-07
  • Python爬蟲(chóng)請(qǐng)求模塊Urllib及Requests庫(kù)安裝使用教程

    Python爬蟲(chóng)請(qǐng)求模塊Urllib及Requests庫(kù)安裝使用教程

    requests和urllib都是Python中常用的HTTP請(qǐng)求庫(kù),使用時(shí)需要根據(jù)實(shí)際情況選擇,如果要求使用簡(jiǎn)單、功能完善、性能高的HTTP請(qǐng)求庫(kù),可以選擇requests,如果需要兼容性更好、功能更加靈活的HTTP請(qǐng)求庫(kù),可以選擇urllib
    2023-11-11
  • python調(diào)用系統(tǒng)中應(yīng)用程序的函數(shù)示例

    python調(diào)用系統(tǒng)中應(yīng)用程序的函數(shù)示例

    這篇文章主要為大家介紹了python調(diào)用系統(tǒng)中應(yīng)用程序詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-06-06
  • Django環(huán)境下使用Ajax的操作代碼

    Django環(huán)境下使用Ajax的操作代碼

    AJAX 的主要目標(biāo)是在不刷新整個(gè)頁(yè)面的情況下,通過(guò)后臺(tái)與服務(wù)器進(jìn)行數(shù)據(jù)交換和更新頁(yè)面內(nèi)容,通過(guò) AJAX,您可以向服務(wù)器發(fā)送請(qǐng)求并接收響應(yīng),然后使用 JavaScript 動(dòng)態(tài)地更新頁(yè)面的部分內(nèi)容,這篇文章主要介紹了Django環(huán)境下使用Ajax,需要的朋友可以參考下
    2024-03-03
  • 使用Pytorch實(shí)現(xiàn)Swish激活函數(shù)的示例詳解

    使用Pytorch實(shí)現(xiàn)Swish激活函數(shù)的示例詳解

    激活函數(shù)是人工神經(jīng)網(wǎng)絡(luò)的基本組成部分,他們將非線性引入模型,使其能夠?qū)W習(xí)數(shù)據(jù)中的復(fù)雜關(guān)系,Swish 激活函數(shù)就是此類(lèi)激活函數(shù)之一,在本文中,我們將深入研究 Swish 激活函數(shù),提供數(shù)學(xué)公式,探索其相對(duì)于 ReLU 的優(yōu)勢(shì),并使用 PyTorch 演示其實(shí)現(xiàn)
    2023-11-11
  • Windows環(huán)境下如何使用Pycharm運(yùn)行sh文件

    Windows環(huán)境下如何使用Pycharm運(yùn)行sh文件

    這篇文章主要介紹了Windows環(huán)境下如何使用Pycharm運(yùn)行sh文件,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2023-02-02
  • python opencv人臉識(shí)別考勤系統(tǒng)的完整源碼

    python opencv人臉識(shí)別考勤系統(tǒng)的完整源碼

    這篇文章主要介紹了python opencv人臉識(shí)別考勤系統(tǒng)的完整源碼,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-04-04

最新評(píng)論