主頁 >  其他 > 聽說越來越卷,那我們就用卷積神經網路CNN來識別狗狗吧!!

聽說越來越卷,那我們就用卷積神經網路CNN來識別狗狗吧!!

2021-08-22 06:36:57 其他

聽說越來越卷,那我們就用卷積神經網路CNN來識別狗狗吧!!

文章目錄

    • 聽說越來越卷,那我們就用卷積神經網路CNN來識別狗狗吧!!
      • 一、識別狗狗
      • 二、CNN簡介
      • 三、環境的配置
        • 1、Python
        • 2、模塊
          • 1)numpy
          • 2)pandas
          • 3)sklearn
          • 4)keras
          • 5)matplotlib.pyplot
          • 6)os
          • 7)TensorFlow
      • 四、獲取狗狗的圖片資訊
      • 五、資料的讀取
      • 六、資料的預處理
      • 七、資料集的分割(劃分為訓練集以及測驗集)
      • 八、CNN 卷積神經網路的搭建
      • 九、訓練CNN 卷積神經網路
      • 十、得到模型
      • 十一、進行測驗檢查預測的效果(檢驗測驗集)
      • 十二、完整的代碼(全部原始碼)
      • 十三、總結

一、識別狗狗

首先介紹博文的內容;

在這篇博文中,

我們將借助Python使用CNN卷積神經網路來進行狗臉的識別,我們知道狗狗是有120多種類別,我們本次的目標就是要通過深度學習使得機器可以區分出來這120種狗狗的類別并且較為準確的將結果告訴使用者,

總之一句話,識別不同狗狗的種類,
(下圖有一只貓,但是我們應該忽略它,因為我們在做狗臉識別,)

在這里插入圖片描述

當然了,

想要區分貓和狗比給狗狗分類要簡單多了,畢竟,貓和狗,這是二元的分類問題;

而,狗狗的不同種類,多打120種,是一個比較多的多元分類,明顯會比較復雜了啦,

本文是要講解識別不同狗狗的種類了啦,

二、CNN簡介

CNN是卷積神經網路,

CNNs是深度卷積神經網路,

神經網路(neual networks)
是人工智能研究領域的一部分,當前最流行的神經網路是深度卷積神經網路(deep convolutional neural networks, CNNs)以及卷積神經網路(CNN),雖然卷積網路也存在淺層結構,但是因為準確度和表現力等原因很少使用,

目前提到CNNs和卷積神經網路(CNN),學術界和工業界不再進行特意區分,一般都指深層結構的卷積神經網路,層數從”幾層“到”幾十上百“不定,

基礎的CNN由
卷積(convolution), 激活(activation), and 池化(pooling)三種結構組成,

CNN輸出的結果是每幅影像的特定特征空間,當處理影像分類任務時,我們會把CNN輸出的特征空間作為全連接層或全連接神經網路(fully connected neural network, FCN)的輸入,用全連接層來完成從輸入影像到標簽集的映射,即分類,

當然,整個程序最重要的作業就是如何通過訓練資料迭代調整網路權重,也就是后向傳播演算法,

目前主流的卷積神經網路(CNNs),比如VGG, ResNet都是由簡單的CNN調整,組合而來,

例如,

對于數字八的識別,我們有如下的操作:

在這里插入圖片描述

它的本質其實就是下面所示的啦,這就是卷積神經網路哦:

在這里插入圖片描述

如果需要進行簡單的描述,那么就是,下面舉一個簡單的例子,如下所示:

將這個簡化
在這里插入圖片描述

于是就變為了:
在這里插入圖片描述

其實,CNN的本質還是梯度下降,只不過這里的反饋與前面的反饋有所不同而已,但是還是同樣的思路,

對于狗狗:
在這里插入圖片描述
(卷積的操作)

在讀入狗狗的資料以后,還會進行例如下圖的類似操作,進行卷積以及池化:
在這里插入圖片描述
還有:(RGB是通過紅、綠、藍三種顏色組合而成的顏色)
在這里插入圖片描述

三、環境的配置

1、Python

人工智能我們還是建議使用Python來完成相關的作業,

同時,Python版本需要3.x的,

2、模塊

在Python中,我們在這個案例中需要用到不少的模塊;

此次我們將使用如下模塊:

1)numpy

這個模塊十分常用,是一個Python處理資料的科學模塊,此處我們會用來處理陣列、矩陣等資料型別的資料,

2)pandas

這個模塊也是十分常用的資料分析模塊,這里我們將主要用來處理DataFrame物件,其實本質上就是張量,

3)sklearn

這個是機器學習的一個模塊,

我們會用它來劃分資料集等等,

4)keras

這是構建卷積神經網路所需要的模塊,我們在這里將會通過Keras模塊來構建卷積神經網路,

5)matplotlib.pyplot

這個是繪圖模塊,可以較為清晰的呈現學習的狀況,

6)os

我們需要讀取資料,因此,os模塊可以較為方便的幫助我們處理檔案的查找以及路徑的尋找等問題,

7)TensorFlow

我們會間接的使用到TensorFlow模塊,

四、獲取狗狗的圖片資訊

原本這些資訊可以在Kaggle上面獲得:

(任意點擊一個就可以了,)

鏈接:
狗狗圖片匯總資料

鏈接是:https://www.kaggle.com/jessicali9530/stanford-dogs-dataset

但是,如果你不懂什么魔法之類的東西,那么你下載起來是很費勁的啦,

因此對于不懂魔法的用戶呢,我將這一份資料放在了我的資源里面,而且是永久免費的哦!!!

截圖為證:
在這里插入圖片描述

這份永久免費的資源的地址是:

有些無良人士直接放空的資源,為了防止大家以為我是這樣的人,于是這個資源是免費的啦,

資源:
Stanford Dogs Dataset.zip

地址;
https://download.csdn.net/download/m0_54218263/21360497?spm=1001.2014.3001.5501

資料集里面的資料有:

120種狗狗的照片,每一種狗狗有150張照片,

在這里插入圖片描述

五、資料的讀取

在讀取資料之前,我們首先匯入一些模塊:

import os
import cv2
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
# this is the split module
from tensorflow import keras
# keras
# use this method to import keras will not appear error
from tensorflow.keras import models, layers
from tensorflow.keras.utils import to_categorical
from sklearn.preprocessing import LabelEncoder
from tensorflow.keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D

接下來,我們進行資料的讀取操作;
(由于資料量巨大,我們這里僅僅只是做10種狗狗的識別,當然120種只需要修改種類數目就可以了啦,)

下面是讀取資料的代碼;


dogs_img_list = os.listdir("Stanford Dogs Dataset/images/images")
for i in dogs_img_list:
    print(i)

root_dir = "Stanford Dogs Dataset/images/images/"
# root package
dog_img_dir = []
# dir of each dog
"""
because of the large quantities of data, 
we just recognize 10 kinds of dogs
"""
for i in range(10):
    # 10 kinds
    dog_img_dir.append(root_dir + dogs_img_list[i])
    # append the message of the dogs
X = []
# X
y_label = []
# y_label
img_size = 150
# the size of the img


def training_data(label, data_dir):
    """
    read data and store them into the X and the y_label
    :param label: the label of the dog, that means the kind of the dog
    :param data_dir: data
    :return: none
    """
    print("reading...", data_dir)
    # tip messages
    for img in os.listdir(data_dir):
        path = os.path.join(data_dir, img)
        img = cv2.imread(path, cv2.IMREAD_COLOR)
        img = cv2.resize(img, (img_size, img_size))
        # X
        X.append(np.array(img))
        # y_label
        y_label.append(str(label))


# use the method above to read the dog's data
for i in range(10):  
    # use 10 to test our main, 10 kinds
    training_data(label=dog_img_dir[i].split("-")[1], data_dir=dog_img_dir[i])

執行代碼以后的效果圖如下:

在這里插入圖片描述

大家注意一下,這里的紅色不是錯誤啊!!

在這里插入圖片描述
這里讀出來了10種狗狗的資料,

六、資料的預處理

進行預處理的代碼如下所示;


# deal with the data
label_encoder = LabelEncoder()
# object
y = label_encoder.fit_transform(y_label)
y = to_categorical(y, 10)
# 10 kinds

X = np.array(X)
X = X / 255
# normalization

七、資料集的分割(劃分為訓練集以及測驗集)

資料集的分割比較簡單,就是把所有的資料分割為訓練集以及測驗集,一般按照80%和20%的比例來進行分割,

這里可以直接使用內置的方法進行分割,也可以自己分割,因為其實就是進行切片而已,這里我們采用內置的方法:

"""
4.split the data collection
"""
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)

這里的代碼就是進行了資料集的分割操作,

這步很簡單了啦,

八、CNN 卷積神經網路的搭建

這一步,我們將要搭建卷積神經網路,

這個就是整個 CNN 卷積神經網路 識別狗狗的專案中的最關鍵的步驟之一,也是訓練機器的程序了啦,


"""
5.training the machine (CNN)
這里的步驟,包括了卷積、池化、卷積、池化的回圈操作,
以及,
展平的操作,
還有,
全連接層和分類輸出,
"""

# CNN
# cnn = models.Sequential()
cnn = models.Sequential()

cnn.add(layers.Conv2D(32, (3, 3), activation="relu", input_shape=(150, 150, 3)))
# 使用 relu 來進行激活神經元
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(64, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(128, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(128, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))

cnn.add(layers.Flatten())

# cnn.add(layers.Dense(512, activation="relu"))
cnn.add(layers.Dense(512, activation="relu"))

# cnn.add(Dense), 120
# cnn.add(layers.Dense(120, activation="softmax"))
cnn.add(layers.Dense(10, activation="softmax"))
# 使用 softmax 激活神經元

# cnn.add(layers.Dense(120, activation="softmax"))
# cnn.add(layers.Dense(120, activation="softmax"))

cnn.compile(loss="categorical_crossentropy", optimizer="rmsprop", metrics=['acc'])
# 損失函式, 優化器, 評估指標

# the code above is to create the cnn
# and the
# train the machine

下面描述一下卷積神經網路的結構:
(由于這里是圖片太長了,所以分割開來展示了)
1、
在這里插入圖片描述
2、
在這里插入圖片描述
3、
在這里插入圖片描述
4、
在這里插入圖片描述
其他的一些解釋如下:

這里解釋了一些名次和概念,
在這里插入圖片描述

九、訓練CNN 卷積神經網路

這里是利用 fit 方法來進行訓練這個搭建好了的神經網路了啦,


"""
6.training the data and get the model
"""

# train

history = cnn.fit(X_train, y_train,  
                  # 指定訓練集
                  epochs=50,  
                  # 指定次數(或者說是輪次)
                  batch_size=256,  
                  # 指定批量的大小
                  validation_data=(X_test, y_test)  
                  # 指定驗證集
                  )



在這里插入圖片描述

以上是使用一個函式進行訓練,十分快捷,

在這里插入圖片描述

十、得到模型

其實模型是在上一個步驟中就已經處理好了,我們只需要呼叫就可以了,為了方便操作,我們首先只迭代一次來看看history究竟是怎么樣的吧:


# train

history = cnn.fit(X_train, y_train,
                  epochs=1,
                  batch_size=256,
                  validation_data=(X_test, y_test))

print(history.history)
print(history.epoch)

輸出如下:

1/6 [====>.........................] - ETA: 0s - loss: 2.3056 - acc: 0.12502021-08-20 10:53:05.338453: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 717750272 exceeds 10% of free system memory.
2021-08-20 10:53:09.549353: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 717750272 exceeds 10% of free system memory.
2/6 [=========>....................] - ETA: 11s - loss: 3.2431 - acc: 0.13092021-08-20 10:53:10.900707: W tensorflow/core/framework/cpu_allocator_impl.cc:81] Allocation of 717750272 exceeds 10% of free system memory.
6/6 [==============================] - 30s 5s/step - loss: 2.6397 - acc: 0.1107 - val_loss: 2.2892 - val_acc: 0.1901
{'loss': [2.639716863632202], 'acc': [0.11074918508529663], 'val_loss': [2.2892367839813232], 'val_acc': [0.1901041716337204]}
[0]

Process finished with exit code 0

這里體現了訓練的程序以及history的內容
History的原始碼是:


@keras_export('keras.callbacks.History')
class History(Callback):
  """Callback that records events into a `History` object.
  This callback is automatically applied to
  every Keras model. The `History` object
  gets returned by the `fit` method of models.
  Example:
  >>> model = tf.keras.models.Sequential([tf.keras.layers.Dense(10)])
  >>> model.compile(tf.keras.optimizers.SGD(), loss='mse')
  >>> history = model.fit(np.arange(100).reshape(5, 20), np.zeros(5),
  ...                     epochs=10)
  >>> print(history.params)
  {'verbose': 1, 'epochs': 10, 'steps': 1}
  >>> # check the keys of history object
  >>> print(history.history.keys())
  dict_keys(['loss'])
  """

  def __init__(self):
    super(History, self).__init__()
    self.history = {}

  def on_train_begin(self, logs=None):
    self.epoch = []

  def on_epoch_end(self, epoch, logs=None):
    logs = logs or {}
    self.epoch.append(epoch)
    for k, v in logs.items():
      self.history.setdefault(k, []).append(v)

    # Set the history attribute on the model after the epoch ends. This will
    # make sure that the state which is set is the latest one.
    self.model.history = self


可以參見Keras原始碼:

Keras

十一、進行測驗檢查預測的效果(檢驗測驗集)

檢驗測驗集的效果,我們主要是看損失的大小了啦,在上面所說的History物件中我們是可以看到loss的啦,測驗的效果通過上面的代碼就可以得到了啦,這里只需要單獨挑出來就好了,


print(history.history)
print(history.epoch)
print(history.history["loss"])

我們設法繪制出來訓練的程序的影像,這個需要matplotlib.pyplot,由于篇幅以及能力的限制(主要是能力的限制,這個模塊我掌握的不太好了啦),所以不展示原始碼,直接展示圖片,有興趣的大佬可以自己進行繪制了啦,

在這里插入圖片描述

十二、完整的代碼(全部原始碼)

這是所有的源代碼,如下所示:

# CNN
"""
1.import modules
there are many modules we need to import
"""
import os
import cv2
import numpy as np
import pandas as pd
from sklearn.model_selection import train_test_split
# this is the split module
from tensorflow import keras
# keras
# use this method to import keras will not appear error
from tensorflow.keras import models, layers
from tensorflow.keras.utils import to_categorical
from sklearn.preprocessing import LabelEncoder
from tensorflow.keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D


"""
2.read the file of the dog pictures
"""
dogs_img_list = os.listdir("Stanford Dogs Dataset/images/images")
for i in dogs_img_list:
    print(i)

root_dir = "Stanford Dogs Dataset/images/images/"
# root package
dog_img_dir = []
# dir of each dog
"""
because of the large quantities of data, 
we just recognize 10 kinds of dogs
"""
for i in range(10):
    # 10 kinds
    dog_img_dir.append(root_dir + dogs_img_list[i])
    # append the message of the dogs
X = []
# X
y_label = []
# y_label
img_size = 150
# the size of the img


def training_data(label, data_dir):
    """
    read data and store them into the X and the y_label
    :param label: the label of the dog, that means the kind of the dog
    :param data_dir: data
    :return: none
    """
    print("reading...", data_dir)
    # tip messages
    for img in os.listdir(data_dir):
        path = os.path.join(data_dir, img)
        img = cv2.imread(path, cv2.IMREAD_COLOR)
        img = cv2.resize(img, (img_size, img_size))
        # X
        X.append(np.array(img))
        # y_label
        y_label.append(str(label))


# use the method above to read the dog's data
for i in range(10):
    # use 10 to test our main, 10 kinds
    training_data(label=dog_img_dir[i].split("-")[1], data_dir=dog_img_dir[i])

"""
3.deal with the data before deep learning
"""
# deal with the data
label_encoder = LabelEncoder()
# object
y = label_encoder.fit_transform(y_label)
# 這是標簽編碼
y = to_categorical(y, 10)
# 這是 One-hot 編碼
# 10 kinds dog

X = np.array(X)
X = X / 255
# normalization

"""
4.split the data collection
"""
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)

"""
5.training the machine (CNN)
這里的步驟,包括了卷積、池化、卷積、池化的回圈操作,
以及,
展平的操作,
還有,
全連接層和分類輸出,
"""

# CNN
# cnn = models.Sequential()
cnn = models.Sequential()

cnn.add(layers.Conv2D(32, (3, 3), activation="relu", input_shape=(150, 150, 3)))
# 使用 relu 來進行激活神經元
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(64, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(128, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(128, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))

cnn.add(layers.Flatten())

# cnn.add(layers.Dense(512, activation="relu"))
cnn.add(layers.Dense(512, activation="relu"))

# cnn.add(Dense), 120
# cnn.add(layers.Dense(120, activation="softmax"))
cnn.add(layers.Dense(10, activation="softmax"))
# 使用 softmax 激活神經元

# cnn.add(layers.Dense(120, activation="softmax"))
# cnn.add(layers.Dense(120, activation="softmax"))

cnn.compile(loss="categorical_crossentropy", optimizer="rmsprop", metrics=['acc'])
# 損失函式, 優化器, 評估指標

# the code above is to create the cnn
# and the
# train the machine

"""
6.training the data and get the model
"""

#
# train
#
#

history = cnn.fit(X_train, y_train,
                  # 指定訓練集
                  epochs=50,
                  # 指定次數(或者說是輪次)
                  batch_size=256,
                  # 指定批量的大小
                  validation_data=(X_test, y_test)
                  # 指定驗證集
                  )



"""
7.show
"""

# show the training result :

print(history)
print(history.history)
print(history.epoch)
# use the dict to show:

print(history.history["loss"])
print(history.history["acc"])
print(history.history["val_loss"])
print(history.history["val_acc"])



下面,

我們還是給出來我第一次學習的時候的源代碼,

如下所示:

from tensorflow import keras
from tensorflow.keras import models, layers
# keras models
from tensorflow.keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPooling2D
import numpy as np
import pandas as pd
import os
import cv2
from sklearn.preprocessing import LabelEncoder
from tensorflow.keras.utils import to_categorical
import matplotlib.pyplot as plt
import random as rdm
from sklearn.model_selection import train_test_split
# to_categorical


dogs_img_list = os.listdir("Stanford Dogs Dataset/images/images")
# read the file name
# print(f'{os.listdir("Stanford Dogs Dataset/images/images")}' +
#       "\n\n" +
#       f"{len(dogs_img_list)}")
# print message

# read the data
dog_img_dir = []
root_dir = "Stanford Dogs Dataset/images/images/"
# root file
for i in range(len(dogs_img_list)):
    dog_img_dir.append(root_dir + dogs_img_list[i])
    # append the message of the dogs
    # and the total of the dogs is 120

# print(dog_img_dir)

X = []
# X
y_label = []
# y_label

img_size = 150


# read the data again
def training_data(label, data_dir):
    print("reading...", data_dir)
    for img in os.listdir(data_dir):
        path = os.path.join(data_dir, img)
        img = cv2.imread(path, cv2.IMREAD_COLOR)
        img = cv2.resize(img, (img_size, img_size))


        # X
        X.append(np.array(img))


        # y_label
        y_label.append(str(label))


# use the method to read dog data
for i in range(10):  # use 10 to test our main
    training_data(label=dog_img_dir[i].split("-")[1], data_dir=dog_img_dir[i])

# deal with the data
label_encoder = LabelEncoder()
# object
y = label_encoder.fit_transform(y_label)
y = to_categorical(y, 10)  # 120
# 120
X = np.array(X)
X = X / 255
# deal

# show
# fig, ax = plt.subplots(5, 2)
# fig.set_size_inches(15, 15)
# for i in range(5):
#     for j in range(2):
#         r = rdm.randint(0, len(X))
#         ax[i, j].imshow(X[r])
#         ax[i, j].set_title('Dog:' + y_label[r])
#         plt.tight_layout()
#         plt.show()

# split

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)


# CNN
# cnn = models.Sequential()
cnn = models.Sequential()


cnn.add(layers.Conv2D(32, (3, 3), activation="relu", input_shape=(150, 150, 3)))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(64, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(128, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))


cnn.add(layers.Conv2D(128, (3, 3), activation="relu"))
cnn.add(layers.MaxPooling2D((2, 2)))

cnn.add(layers.Flatten())

# cnn.add(layers.Dense(512, activation="relu"))
cnn.add(layers.Dense(512, activation="relu"))

# cnn.add(Dense), 120
# cnn.add(layers.Dense(120, activation="softmax"))
cnn.add(layers.Dense(10, activation="softmax"))

# cnn.add(layers.Dense(120, activation="softmax"))
# cnn.add(layers.Dense(120, activation="softmax"))


cnn.compile(loss="categorical_crossentropy", optimizer="rmsprop", metrics=['acc'])

# create the cnn

# train

history = cnn.fit(X_train, y_train,
                  epochs=50,
                  batch_size=256,
                  validation_data=(X_test, y_test))

print(history.history)
print(history.epoch)
print(history.history["loss"])
print(history.history["acc"])
print(history.history["val_loss"])
print(history.history["val_acc"])

運行代碼的結果展示:

Epoch 1/50
6/6 [==============================] - 24s 4s/step - loss: 2.8308 - acc: 0.1309 - val_loss: 2.2881 - val_acc: 0.0911
Epoch 2/50
6/6 [==============================] - 27s 5s/step - loss: 2.2932 - acc: 0.1479 - val_loss: 2.2671 - val_acc: 0.1875
Epoch 3/50
6/6 [==============================] - 27s 5s/step - loss: 2.2643 - acc: 0.1831 - val_loss: 2.2666 - val_acc: 0.1328
Epoch 4/50
6/6 [==============================] - 27s 4s/step - loss: 2.2247 - acc: 0.1635 - val_loss: 2.2222 - val_acc: 0.2083
Epoch 5/50
6/6 [==============================] - 22s 4s/step - loss: 2.4839 - acc: 0.1993 - val_loss: 2.2434 - val_acc: 0.1901
Epoch 6/50
6/6 [==============================] - 22s 4s/step - loss: 2.1675 - acc: 0.2306 - val_loss: 2.1828 - val_acc: 0.1953
Epoch 7/50
6/6 [==============================] - 25s 4s/step - loss: 2.1461 - acc: 0.2521 - val_loss: 2.1681 - val_acc: 0.2396
Epoch 8/50
6/6 [==============================] - 31s 5s/step - loss: 2.0721 - acc: 0.2775 - val_loss: 2.3079 - val_acc: 0.1927
Epoch 9/50
6/6 [==============================] - 28s 5s/step - loss: 2.0610 - acc: 0.2879 - val_loss: 2.2057 - val_acc: 0.2396
Epoch 10/50
6/6 [==============================] - 28s 5s/step - loss: 1.9759 - acc: 0.3270 - val_loss: 2.0423 - val_acc: 0.3099
Epoch 11/50
6/6 [==============================] - 27s 5s/step - loss: 1.8886 - acc: 0.3336 - val_loss: 2.0655 - val_acc: 0.2448
Epoch 12/50
6/6 [==============================] - 27s 5s/step - loss: 1.8554 - acc: 0.3687 - val_loss: 2.0126 - val_acc: 0.3203
Epoch 13/50
6/6 [==============================] - 28s 5s/step - loss: 1.9623 - acc: 0.3283 - val_loss: 1.9592 - val_acc: 0.3307
Epoch 14/50
6/6 [==============================] - 25s 4s/step - loss: 1.7121 - acc: 0.4104 - val_loss: 2.0791 - val_acc: 0.2839
Epoch 15/50
6/6 [==============================] - 26s 4s/step - loss: 1.6828 - acc: 0.4156 - val_loss: 2.0520 - val_acc: 0.3698
Epoch 16/50
6/6 [==============================] - 28s 5s/step - loss: 1.6389 - acc: 0.4515 - val_loss: 1.9933 - val_acc: 0.3307
Epoch 17/50
6/6 [==============================] - 28s 5s/step - loss: 1.5336 - acc: 0.4638 - val_loss: 2.2346 - val_acc: 0.2292
Epoch 18/50
6/6 [==============================] - 28s 5s/step - loss: 1.6407 - acc: 0.4463 - val_loss: 1.9287 - val_acc: 0.3411
Epoch 19/50
6/6 [==============================] - 27s 4s/step - loss: 1.3706 - acc: 0.5290 - val_loss: 2.3511 - val_acc: 0.3047
Epoch 20/50
6/6 [==============================] - 27s 4s/step - loss: 1.3332 - acc: 0.5446 - val_loss: 2.1613 - val_acc: 0.2995
Epoch 21/50
6/6 [==============================] - 25s 4s/step - loss: 1.1409 - acc: 0.6143 - val_loss: 2.1760 - val_acc: 0.2552
Epoch 22/50
6/6 [==============================] - 34s 6s/step - loss: 1.0946 - acc: 0.6391 - val_loss: 2.3750 - val_acc: 0.3281
Epoch 23/50
6/6 [==============================] - 29s 5s/step - loss: 1.0019 - acc: 0.6606 - val_loss: 2.7618 - val_acc: 0.3047
Epoch 24/50
6/6 [==============================] - 28s 5s/step - loss: 0.9748 - acc: 0.6664 - val_loss: 2.1869 - val_acc: 0.3750
Epoch 25/50
6/6 [==============================] - 27s 5s/step - loss: 0.7259 - acc: 0.7518 - val_loss: 2.3144 - val_acc: 0.3385
Epoch 26/50
6/6 [==============================] - 26s 4s/step - loss: 0.5905 - acc: 0.8046 - val_loss: 2.4587 - val_acc: 0.3177
Epoch 27/50
6/6 [==============================] - 26s 4s/step - loss: 0.6956 - acc: 0.7524 - val_loss: 2.9642 - val_acc: 0.2891
Epoch 28/50
6/6 [==============================] - 26s 4s/step - loss: 0.4431 - acc: 0.8619 - val_loss: 2.7440 - val_acc: 0.3620
Epoch 29/50
6/6 [==============================] - 27s 5s/step - loss: 0.3499 - acc: 0.9010 - val_loss: 4.2927 - val_acc: 0.2630
Epoch 30/50
6/6 [==============================] - 27s 5s/step - loss: 0.9952 - acc: 0.7629 - val_loss: 2.5862 - val_acc: 0.3542
Epoch 31/50
6/6 [==============================] - 21s 4s/step - loss: 0.1439 - acc: 0.9746 - val_loss: 3.0547 - val_acc: 0.3229
Epoch 32/50
6/6 [==============================] - 26s 4s/step - loss: 0.0806 - acc: 0.9850 - val_loss: 3.7483 - val_acc: 0.3203
Epoch 33/50
6/6 [==============================] - 29s 5s/step - loss: 0.5830 - acc: 0.8436 - val_loss: 3.2535 - val_acc: 0.3281
Epoch 34/50
6/6 [==============================] - 28s 5s/step - loss: 0.0856 - acc: 0.9876 - val_loss: 3.3920 - val_acc: 0.3802
Epoch 35/50
6/6 [==============================] - 27s 5s/step - loss: 0.0267 - acc: 0.9961 - val_loss: 3.7781 - val_acc: 0.3802
Epoch 36/50
6/6 [==============================] - 21s 3s/step - loss: 0.0203 - acc: 0.9974 - val_loss: 4.0570 - val_acc: 0.3568
Epoch 37/50
6/6 [==============================] - 27s 5s/step - loss: 0.0121 - acc: 0.9993 - val_loss: 4.2549 - val_acc: 0.3828
Epoch 38/50
6/6 [==============================] - 28s 5s/step - loss: 1.1171 - acc: 0.7844 - val_loss: 2.7973 - val_acc: 0.3047
Epoch 39/50
6/6 [==============================] - 29s 5s/step - loss: 0.2973 - acc: 0.9094 - val_loss: 3.1806 - val_acc: 0.3672
Epoch 40/50
6/6 [==============================] - 30s 5s/step - loss: 0.0297 - acc: 0.9987 - val_loss: 3.5742 - val_acc: 0.3620
Epoch 41/50
6/6 [==============================] - 29s 5s/step - loss: 0.0139 - acc: 0.9993 - val_loss: 3.8064 - val_acc: 0.3464
Epoch 42/50
6/6 [==============================] - 27s 5s/step - loss: 0.0142 - acc: 0.9987 - val_loss: 3.9564 - val_acc: 0.3750
Epoch 43/50
6/6 [==============================] - 28s 5s/step - loss: 0.0124 - acc: 0.9987 - val_loss: 4.1338 - val_acc: 0.3542
Epoch 44/50
6/6 [==============================] - 26s 4s/step - loss: 0.0080 - acc: 0.9987 - val_loss: 4.8518 - val_acc: 0.3333
Epoch 45/50
6/6 [==============================] - 26s 4s/step - loss: 1.5938 - acc: 0.7107 - val_loss: 3.4182 - val_acc: 0.2891
Epoch 46/50
6/6 [==============================] - 24s 4s/step - loss: 0.1018 - acc: 0.9811 - val_loss: 3.4852 - val_acc: 0.3620
Epoch 47/50
6/6 [==============================] - 24s 4s/step - loss: 0.0216 - acc: 0.9987 - val_loss: 3.8207 - val_acc: 0.3516
Epoch 48/50
6/6 [==============================] - 24s 4s/step - loss: 0.0133 - acc: 0.9987 - val_loss: 4.0269 - val_acc: 0.3594
Epoch 49/50
6/6 [==============================] - 24s 4s/step - loss: 0.0069 - acc: 0.9993 - val_loss: 4.2136 - val_acc: 0.3490
Epoch 50/50
6/6 [==============================] - 24s 4s/step - loss: 0.0062 - acc: 0.9993 - val_loss: 4.4008 - val_acc: 0.3542
<tensorflow.python.keras.callbacks.History object at 0x000001F137C33D60>
{'loss': [2.8308050632476807, 2.29323410987854, 2.2643165588378906, 2.224742889404297, 2.483851909637451, 2.167505979537964, 2.1461405754089355, 2.0721473693847656, 2.060950756072998, 1.975879430770874, 1.8886222839355469, 1.8553621768951416, 1.9623366594314575, 1.712108850479126, 1.6827651262283325, 1.6388875246047974, 1.5335570573806763, 1.6407216787338257, 1.3706496953964233, 1.3331533670425415, 1.1409199237823486, 1.0945615768432617, 1.0019456148147583, 0.9748384356498718, 0.725939929485321, 0.5904505848884583, 0.6956182718276978, 0.44307371973991394, 0.34993064403533936, 0.9951552748680115, 0.14394378662109375, 0.08060862123966217, 0.5830209851264954, 0.08558905124664307, 0.02666712924838066, 0.02026943676173687, 0.012054797261953354, 1.1171202659606934, 0.2973436713218689, 0.029678216204047203, 0.013883446343243122, 0.014234034344553947, 0.01236400380730629, 0.008039926178753376, 1.593753457069397, 0.10175592452287674, 0.021587485447525978, 0.013339064083993435, 0.0068833790719509125, 0.006158844102174044], 'acc': [0.13094462454319, 0.14788272976875305, 0.183061882853508, 0.16351792216300964, 0.1993485391139984, 0.2306188941001892, 0.2521172761917114, 0.2775244414806366, 0.2879478931427002, 0.3270358443260193, 0.33355048298835754, 0.3687296509742737, 0.32833877205848694, 0.4104234576225281, 0.4156351685523987, 0.45146578550338745, 0.4638436436653137, 0.44625407457351685, 0.5289902091026306, 0.5446254014968872, 0.6143322587013245, 0.639087975025177, 0.6605862975120544, 0.6664494872093201, 0.7517915368080139, 0.8045602440834045, 0.7524430155754089, 0.8618892431259155, 0.9009771943092346, 0.7628664374351501, 0.9745928049087524, 0.9850162863731384, 0.8436481952667236, 0.9876221418380737, 0.9960911870002747, 0.9973941445350647, 0.999348521232605, 0.7843648195266724, 0.9094462394714355, 0.99869704246521, 0.999348521232605, 0.99869704246521, 0.99869704246521, 0.99869704246521, 0.7107492089271545, 0.9811074733734131, 0.99869704246521, 0.99869704246521, 0.999348521232605, 0.999348521232605], 'val_loss': [2.288085699081421, 2.267096996307373, 2.2665584087371826, 2.222180128097534, 2.243370532989502, 2.182835340499878, 2.168098211288452, 2.307891607284546, 2.2056803703308105, 2.0422720909118652, 2.06552791595459, 2.0126335620880127, 1.9592050313949585, 2.0791280269622803, 2.0520381927490234, 1.9932855367660522, 2.2345681190490723, 1.9287039041519165, 2.351067304611206, 2.1612789630889893, 2.1759769916534424, 2.3750038146972656, 2.7618110179901123, 2.1868669986724854, 2.314356565475464, 2.458726167678833, 2.9641971588134766, 2.743975877761841, 4.292697429656982, 2.5861711502075195, 3.0546534061431885, 3.7482855319976807, 3.2534897327423096, 3.3919646739959717, 3.778139114379883, 4.056985378265381, 4.254880428314209, 2.797269582748413, 3.180584192276001, 3.5741913318634033, 3.8063831329345703, 3.956415891647339, 4.133772373199463, 4.851773738861084, 3.4182348251342773, 3.485194444656372, 3.8206732273101807, 4.026876449584961, 4.213562488555908, 4.400800704956055], 'val_acc': [0.0911458358168602, 0.1875, 0.1328125, 0.2083333283662796, 0.1901041716337204, 0.1953125, 0.2395833283662796, 0.1927083283662796, 0.2395833283662796, 0.3098958432674408, 0.2447916716337204, 0.3203125, 0.3307291567325592, 0.2838541567325592, 0.3697916567325592, 0.3307291567325592, 0.2291666716337204, 0.3411458432674408, 0.3046875, 0.2994791567325592, 0.2552083432674408, 0.328125, 0.3046875, 0.375, 0.3385416567325592, 0.3177083432674408, 0.2890625, 0.3619791567325592, 0.2630208432674408, 0.3541666567325592, 0.3229166567325592, 0.3203125, 0.328125, 0.3802083432674408, 0.3802083432674408, 0.3567708432674408, 0.3828125, 0.3046875, 0.3671875, 0.3619791567325592, 0.3463541567325592, 0.375, 0.3541666567325592, 0.3333333432674408, 0.2890625, 0.3619791567325592, 0.3515625, 0.359375, 0.3489583432674408, 0.3541666567325592]}
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]
[2.8308050632476807, 2.29323410987854, 2.2643165588378906, 2.224742889404297, 2.483851909637451, 2.167505979537964, 2.1461405754089355, 2.0721473693847656, 2.060950756072998, 1.975879430770874, 1.8886222839355469, 1.8553621768951416, 1.9623366594314575, 1.712108850479126, 1.6827651262283325, 1.6388875246047974, 1.5335570573806763, 1.6407216787338257, 1.3706496953964233, 1.3331533670425415, 1.1409199237823486, 1.0945615768432617, 1.0019456148147583, 0.9748384356498718, 0.725939929485321, 0.5904505848884583, 0.6956182718276978, 0.44307371973991394, 0.34993064403533936, 0.9951552748680115, 0.14394378662109375, 0.08060862123966217, 0.5830209851264954, 0.08558905124664307, 0.02666712924838066, 0.02026943676173687, 0.012054797261953354, 1.1171202659606934, 0.2973436713218689, 0.029678216204047203, 0.013883446343243122, 0.014234034344553947, 0.01236400380730629, 0.008039926178753376, 1.593753457069397, 0.10175592452287674, 0.021587485447525978, 0.013339064083993435, 0.0068833790719509125, 0.006158844102174044]
[0.13094462454319, 0.14788272976875305, 0.183061882853508, 0.16351792216300964, 0.1993485391139984, 0.2306188941001892, 0.2521172761917114, 0.2775244414806366, 0.2879478931427002, 0.3270358443260193, 0.33355048298835754, 0.3687296509742737, 0.32833877205848694, 0.4104234576225281, 0.4156351685523987, 0.45146578550338745, 0.4638436436653137, 0.44625407457351685, 0.5289902091026306, 0.5446254014968872, 0.6143322587013245, 0.639087975025177, 0.6605862975120544, 0.6664494872093201, 0.7517915368080139, 0.8045602440834045, 0.7524430155754089, 0.8618892431259155, 0.9009771943092346, 0.7628664374351501, 0.9745928049087524, 0.9850162863731384, 0.8436481952667236, 0.9876221418380737, 0.9960911870002747, 0.9973941445350647, 0.999348521232605, 0.7843648195266724, 0.9094462394714355, 0.99869704246521, 0.999348521232605, 0.99869704246521, 0.99869704246521, 0.99869704246521, 0.7107492089271545, 0.9811074733734131, 0.99869704246521, 0.99869704246521, 0.999348521232605, 0.999348521232605]
[2.288085699081421, 2.267096996307373, 2.2665584087371826, 2.222180128097534, 2.243370532989502, 2.182835340499878, 2.168098211288452, 2.307891607284546, 2.2056803703308105, 2.0422720909118652, 2.06552791595459, 2.0126335620880127, 1.9592050313949585, 2.0791280269622803, 2.0520381927490234, 1.9932855367660522, 2.2345681190490723, 1.9287039041519165, 2.351067304611206, 2.1612789630889893, 2.1759769916534424, 2.3750038146972656, 2.7618110179901123, 2.1868669986724854, 2.314356565475464, 2.458726167678833, 2.9641971588134766, 2.743975877761841, 4.292697429656982, 2.5861711502075195, 3.0546534061431885, 3.7482855319976807, 3.2534897327423096, 3.3919646739959717, 3.778139114379883, 4.056985378265381, 4.254880428314209, 2.797269582748413, 3.180584192276001, 3.5741913318634033, 3.8063831329345703, 3.956415891647339, 4.133772373199463, 4.851773738861084, 3.4182348251342773, 3.485194444656372, 3.8206732273101807, 4.026876449584961, 4.213562488555908, 4.400800704956055]
[0.0911458358168602, 0.1875, 0.1328125, 0.2083333283662796, 0.1901041716337204, 0.1953125, 0.2395833283662796, 0.1927083283662796, 0.2395833283662796, 0.3098958432674408, 0.2447916716337204, 0.3203125, 0.3307291567325592, 0.2838541567325592, 0.3697916567325592, 0.3307291567325592, 0.2291666716337204, 0.3411458432674408, 0.3046875, 0.2994791567325592, 0.2552083432674408, 0.328125, 0.3046875, 0.375, 0.3385416567325592, 0.3177083432674408, 0.2890625, 0.3619791567325592, 0.2630208432674408, 0.3541666567325592, 0.3229166567325592, 0.3203125, 0.328125, 0.3802083432674408, 0.3802083432674408, 0.3567708432674408, 0.3828125, 0.3046875, 0.3671875, 0.3619791567325592, 0.3463541567325592, 0.375, 0.3541666567325592, 0.3333333432674408, 0.2890625, 0.3619791567325592, 0.3515625, 0.359375, 0.3489583432674408, 0.3541666567325592]

一共運行了50次輪回,

十三、總結

以上就是我們使用CNN卷積神經網路來寫的一個狗狗的類別的識別的一個小的機器識別學習專案的所有內容,這里我們做了10個種類的狗狗的識別作業,如果是120種的話,直接把引數設定為120種就可以了啦,

以上是進行了CNN的應用,沒有涉及到太多的原理,后續會出一期博文手寫CNN演算法,

希望本文對大家有一定的幫助了啦,

最后,感謝大家的閱讀與支持了啦,

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/295326.html

標籤:AI

上一篇:AndrewNg機器學習編程作業python實作及心得總結

下一篇:Deep Learning for EEG-Based Preference Classification in Neuromarketing文章精讀導讀,深度學習在神經營銷中基于腦電的偏好分類

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more