自定义敏感词检测器_使用转移学习创建自己的自定义对象检测器

自定义敏感词检测器

This article aims to help out beginners in machine learning on creating your own custom object detector. I have been trying to create a simple object detector and had to go through many articles spread across the internet to find all the required information. So I figured I’ll gather all the information I found in one place to make things easier for the next me.I’ll keep this as easy and informative as possible.

本文旨在帮助机器学习的初学者创建自己的自定义对象检测器。 我一直在尝试创建一个简单的对象检测器,不得不浏览遍及Internet的许多文章以找到所有必需的信息。 所以我想我将在一个地方收集到的所有信息使下一个我更轻松,我将尽可能地保持信息的便利性。

This article describes everything required to create a working object detector from gathering data to exporting the model for our use.

本文介绍了创建工作对象检测器所需的一切,从收集数据到导出模型供我们使用。

  1. Prerequisites

    先决条件
  2. Setting up the work environment

    搭建工作环境
  3. Making the dataset

    制作数据集
  4. Downloading and configuring the pre-trained model

    下载和配置预训练的模型
  5. Training and evaluation

    培训与评估
  6. Exporting the model

    导出模型

先决条件 (Prerequisites)

This tutorial does not assume any previous knowledge of TensorFlow. I have tried to keep it as simple as I can so that anyone could get a working model at the end. For beginners, I definitely suggest this exercise as I found it to be an excellent first step into the world of transfer learning.

本教程不假定您具有TensorFlow的任何先前知识。 我已尽力使它保持简单,以便任何人最终都能得到可行的模型。 对于初学者,我绝对建议进行此练习,因为我发现它是进入迁移学习领域的绝佳第一步。

This tutorial utilizes Python. Several python packages are required to get this going. I’m just going to list them below. If you are reading this, you’ll probably have them already installed. If not, all these packages are very popular and there are lots of tutorials on the internet on how to install them.

本教程使用Python。 要执行此操作,需要几个python软件包。 我将在下面列出它们。 如果您正在阅读本文,则可能已经安装了它们。 如果没有,那么所有这些软件包都非常受欢迎,并且互联网上有很多关于如何安装它们的教程。

  1. Pandas

    大熊猫
  2. Tensorflow

    张量流
  3. Tensorboard (Optional)

    张量板(可选)
  4. Openimages

    打开图像

安装TensorFlow对象检测API (Installing TensorFlow Object Detection API)

We are going to use TensorFlow Object Detection API to perform transfer learning.

我们将使用TensorFlow对象检测API进行转移学习。

To install TensorFlow API, git clone the following repository to your computer.

要安装TensorFlow API,请git将以下存储库克隆到您的计算机。

The Tensorflow Object Detection API uses Protobufs to configure model and training parameters. To use Protobufs, the library needs to be downloaded and compiled.

Tensorflow对象检测API使用Protobufs配置模型和训练参数。 要使用Protobuf,需要下载并编译该库。

  1. Go to Protobufs and download the latest version of protoc for your system.

    转到Protobufs并为您的系统下载最新版本的protoc

  2. Extract the contents of the downloaded zip to a folder. You can find the protoc file inside the bin folder.

    将下载的zip的内容提取到一个文件夹中。 您可以在bin文件夹中找到protoc文件。

  3. Run the following command from within the TensorFlow/models/research folder inside the repository that you cloned.

    从克隆的存储库内的TensorFlow / models / research文件夹中运行以下命令。

protoc object_detection/protos/*.proto --python_out=.

测试安装 (Testing your installation)

To test the installation, run the following command from within Tensorflow/models/research :

要测试安装,请在Tensorflow / models / research中运行以下命令:

python3 object_detection/builders/model_builder_tf2_test.py

Successful installation will result in an output similar to

成功安装将产生类似于以下内容的输出


[ OK ] ModelBuilderTF2Test.test_create_ssd_models_from_config
[ RUN ] ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update
[ OK ] ModelBuilderTF2Test.test_invalid_faster_rcnn_batchnorm_update
[ RUN ] ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold
[ OK ] ModelBuilderTF2Test.test_invalid_first_stage_nms_iou_threshold
[ RUN ] ModelBuilderTF2Test.test_invalid_model_config_proto
[ OK ] ModelBuilderTF2Test.test_invalid_model_config_proto
[ RUN ] ModelBuilderTF2Test.test_invalid_second_stage_batch_size
[ OK ] ModelBuilderTF2Test.test_invalid_second_stage_batch_size
[ RUN ] ModelBuilderTF2Test.test_session
[ SKIPPED ] ModelBuilderTF2Test.test_session
[ RUN ] ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor
[ OK ] ModelBuilderTF2Test.test_unknown_faster_rcnn_feature_extractor
[ RUN ] ModelBuilderTF2Test.test_unknown_meta_architecture
[ OK ] ModelBuilderTF2Test.test_unknown_meta_architecture
[ RUN ] ModelBuilderTF2Test.test_unknown_ssd_feature_extractor
[ OK ] ModelBuilderTF2Test.test_unknown_ssd_feature_extractor
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Ran 20 tests in 68.510sOK (skipped=1)

We are all set to create our own object detector model.

我们都准备创建自己的对象检测器模型。

搭建工作环境 (Setting up the work environment)

Since the project files have similar names and can get very confusing, I have made a project file structure to avoid confusion. Git clone this repository to get started.

由于项目文件具有相似的名称,并且会造成混乱,因此,我制作了一个项目文件结构以避免混淆。 Git克隆此存储库以开始。

Inside the Project folder, you will find 6 subfolders :

Project文件夹中,您将找到6个子文件夹:

  1. Annotations: It will hold all the TFRecords and label maps.

    注释 :它将保存所有TFRecords和标签图。

  2. Images: It will hold all the images for training and test in two folders.

    图像 :它将所有用于训练和测试的图像保存在两个文件夹中。

  3. Pretrained models: It will hold our pretrained models in different folders.

    预训练模型 :它将我们的预训练模型保存在不同的文件夹中。

  4. Models: It will hold all the model checkpoints after training.

    模型 :训练后将保存所有模型检查点。

  5. Exported models: It will hold all the models that are exported after training.

    导出的模型 :它将保存训练后导出的所有模型。

  6. Scripts: It will hold all the code required for this project.

    脚本 :它将保存此项目所需的所有代码。

Copy the files model_main_tf2.py and exporter_main_v2.py from TensorFlow/models/research/object_detection/ in the Tensorflow/models repository that you cloned during the installation of Tensorflow Object Detection API to the Scripts folder in the Project folder.

将您在安装Tensorflow对象检测API期间克隆的Tensorflow / models存储库中的TensorFlow / models / research / object_detection /中的文件model_main_tf2.pyexporter_main_v2.py复制到Project文件夹中的Scripts文件夹中。

制作数据集 (Making the Dataset)

In this tutorial, we are going to use Google’s OpenImages dataset which contains millions of images grouped into thousands of labels with bounding boxes. For any regular object, chances are you will find it in this dataset.

在本教程中,我们将使用Google的OpenImages数据集,其中包含数百万个图像,这些图像被分组为带有边界框的数千个标签。 对于任何常规对象,很可能会在此数据集中找到它。

Since it is impractical to download such a huge dataset, we employ openimages API for this. We have already installed this in our prerequisites.

由于下载如此庞大的数据集是不切实际的,因此我们为此使用了openimages API。 我们已经在先决条件中安装了它。

You can use the following command to download the dataset with the arguments

您可以使用以下命令下载带有参数的数据集

  • csv_dir — where the CSV files will be downloaded to

    csv_dir-将CSV文件下载到的位置
  • base_dir — where the images and annotations in XML format will be downloaded to. It is best to keep these locations to single folder

    base_dir —将XML格式的图像和注释下载到的位置。 最好将这些位置保留在单个文件夹中
  • labels — the labels for which images are to be downloaded

    标签—要为其下载图像的标签
  • format — pascal or darknet. These are two popular annotations formats. We are going to use the pascal format

    格式-pascal或darknet。 这是两种流行的注释格式。 我们将使用pascal格式
  • limit — The maximum number of images of each class type

    limit —每个类类型的最大图像数

Replace the locations and labels with your requirements and run the command. Downloading the data will take some time.

根据需要替换位置和标签,然后运行命令。 下载数据需要一些时间。

oi_download_dataset — csv_dir ~/<dir_A> — base_dir ~/<dir_A> — labels Zebra Binoculars — format pascal — limit 200

What if required label is not in OpenImages dataset ?

如果所需标签不在OpenImages数据集中怎么办?

We can also use LabelImg tool for labelling.How to use it is a story for another blog. It is simple to install and use.You’ll figure it out.

我们也可以使用LabelImg工具进行标签。如何使用它是另一个博客的故事。 它很容易安装和使用。您会弄清楚的。

Once the data is downloaded to the corresponding folder, we can find it to be divided into folders based on labels which again contains images and annotations as sub-folders. Move all these files outside to our images folder.

数据下载到相应的文件夹后,我们可以根据标签将其分为多个文件夹,这些标签再次包含图像和注释作为子文件夹。 将所有这些文件移到我们的图像文件夹之外。

So now we have a folder with all images and XML files in one place.

因此,现在我们有了一个文件夹,其中所有图像和XML文件都放在一个位置。

拆分训练和测试 (Splitting to train and test)

Inside the scripts folder, you will find a python file partition_dataset.py.

在scripts文件夹中,您会找到一个python文件partition_dataset.py。

Run this file using the following command

使用以下命令运行此文件

python3 partition_dataset.py -x -i [PATH_TO_IMAGES_FOLDER] -r 0.1

Here the 10% of the images are used for the test set. You can change this by modifying the -r argument. Give the images folder as the -i argument.

在这里,10%的图像用于测试集。 您可以通过修改-r参数来更改此设置。 将images文件夹指定为-i参数。

After running the command, you will find the images folder containing images and XML files split into two folders train and test using the given ratio.

运行命令后,您将找到包含图像和XML文件的images文件夹,该文件夹分为两个文件夹,并使用给定的比率进行测试。

Once you make sure the files are safely copied you can delete the originals.

确保安全复制文件后,即可删除原始文件。

创建标签图 (Creating the label map)

Inside the annotations folder, you will find a file label_map.pbtxt containing labels in the format

在注解文件夹中,您将找到一个label_map.pbtxt文件, 其中包含以下格式的标签

item {
id: 1
name: 'bed'
}item {
id: 2
name: 'bench'
}

Modify this file by adding your labels in the given format and save it.

通过以给定的格式添加标签来修改此文件并保存。

转换为TFRecords (Converting to TFRecords)

TFRecord file stores your data as a sequence of binary strings. This can improve the performance of your process drastically. So here we are going to convert the data in our XML files to tfrecord format for faster execution.

TFRecord文件将您的数据存储为二进制字符串序列。 这可以大大提高您的过程的性能。 因此,这里我们将XML文件中的数据转换为tfrecord格式,以加快执行速度。

To convert XML files to tfrecords, we use the generate_tfrecord.py script inside the scripts folder with the commands

要将XML文件转换为tfrecords,我们将scripts文件夹内的generate_tfrecord.py脚本与命令一起使用

# Create train data:
python3 generate_tfrecord.py -x [PATH_TO_IMAGES_FOLDER]/train -l [PATH_TO_ANNOTATIONS_FOLDER]/label_map.pbtxt -o [PATH_TO_ANNOTATIONS_FOLDER]/train.record -c [PATH_TO_ANNOTATIONS_FOLDER]/train.csv# Create test data:
python3 generate_tfrecord.py -x [PATH_TO_IMAGES_FOLDER]/test -l [PATH_TO_ANNOTATIONS_FOLDER]/label_map.pbtxt -o [PATH_TO_ANNOTATIONS_FOLDER]/test.record -c [PATH_TO_ANNOTATIONS_FOLDER]/test.csv

Once we run these scripts, we can find two tfrecord files and two CSV files inside our annotations folder.

一旦运行了这些脚本,我们便可以在注释文件夹中找到两个tfrecord文件和两个CSV文件。

Be sure to make sure that the data from the XML files are copied over to the CSV files correctly. This can be done by simply comparing the values in one XML file and its corresponding column in the CSV file. Inconsistency between these can lead to errors in the future that will be difficult to debug.

请确保将XML文件中的数据正确复制到CSV文件中。 只需将一个XML文件中的值与其CSV文件中的相应列进行比较,即可完成此操作。 这些之间的不一致会导致将来出现难以调试的错误。

Some of you may have the dataset in the form of .csv files. I have included a dataset.csv file inside the annotations folder that prescribes the format of how the data should be formatted for use in these models. Convert your CSV files to the prescribed format and convert them to tfrecords to continue with the tutorial. Project/scripts/generate_tfrecord_csv.py can help you with the conversion.

你们中的某些人可能具有.csv文件形式的数据集。 我在注解文件夹中包含了一个dataset.csv文件,该文件规定了在这些模型中应如何格式化数据的格式。 将您的CSV文件转换为指定的格式,并将它们转换为tfrecords,以继续本教程。 Project / scripts / generate_tfrecord_csv.py可以帮助您进行转换。

下载和配置预训练的模型 (Downloading and configuring the pre-trained model)

Plenty of pre-trained detection models are available at Tensorflow Model Zoo. Download your preferred model from it as a compressed file.

大量的预训练检测模型可在 Tensorflow模型动物园 。 从其下载首选模型作为压缩文件。

Extract this tar.gz file into the pretrained models folder. An example is placed in the folder.

将此tar.gz文件解压缩到预先训练的模型文件夹中。 在文件夹中放置一个示例。

To configure this pretrained model for our use, create a sub-folder with the name of the model you are using in the models folder(This folder will be referred to as modelname from henceforth). Copy the pipeline.config file from the downloaded folder into the modelname folder. This file contains the configurations for the training pipeline. An example file is kept in the models folder.

要配置此预训练模型供我们使用,请在models文件夹中创建一个子文件夹,并在其中使用您正在使用的模型的名称(此文件夹从此以后称为modelname )。 将pipeline.config文件从下载的文件夹复制到modelname文件夹。 该文件包含培训管道的配置。 示例文件保存在models文件夹中。

We have to modify these configurations to suit your needs. Some parameters you will need to modify are listed below.

我们必须修改这些配置以适合您的需求。 下面列出了您需要修改的一些参数。

  1. num_classes: Number of class labels detected using the detector. Change this to the number of class labels required in your detector.

    num_classes :使用检测器检测到的类标签数。 将其更改为检测器中所需的类标签数。

  2. batch_size: Batch size used for training. Change this value according to your memory availability. A higher batch size requires higher memory.

    batch_size :用于训练的批次大小。 根据您的内存可用性更改此值。 较高的批处理大小需要较高的内存。

  3. fine_tune_checkpoint: Path to the checkpoint of the pretrained model.

    fine_tune_checkpoint :预训练模型的检查点的路径。

  4. fine_tune_checkpoint_type : Set this to “detection”.

    fine_tune_checkpoint_type :将其设置为“检测”。

  5. label_map_path : Path to the label_map.pbtxt file we created earlier.

    label_map_path :我们之前创建的label_map.pbtxt文件的路径。

  6. input_path: Path to the tfrecord files we created earlier.

    input_path :我们之前创建的tfrecord文件的路径。

I have marked these parameters in an example file by using comments below.

我通过使用以下注释在示例文件中标记了这些参数。

model {
  ssd {
    num_classes: 6   #Change this to required number of classes
    image_resizer {
      fixed_shape_resizer {
        height: 640
        width: 640
      }
    }
    feature_extractor {
      type: "ssd_mobilenet_v2_fpn_keras"
      depth_multiplier: 1.0
      min_depth: 16
      conv_hyperparams {
        regularizer {
          l2_regularizer {
            weight: 3.9999998989515007e-05
          }
        }
        initializer {
          random_normal_initializer {
            mean: 0.0
            stddev: 0.009999999776482582
          }
        }
        activation: RELU_6
        batch_norm {
          decay: 0.996999979019165
          scale: true
          epsilon: 0.0010000000474974513
        }
      }
      use_depthwise: true
      override_base_feature_extractor_hyperparams: true
      fpn {
        min_level: 3
        max_level: 7
        additional_layer_depth: 128
      }
    }
    box_coder {
      faster_rcnn_box_coder {
        y_scale: 10.0
        x_scale: 10.0
        height_scale: 5.0
        width_scale: 5.0
      }
    }
    matcher {
      argmax_matcher {
        matched_threshold: 0.5
        unmatched_threshold: 0.5
        ignore_thresholds: false
        negatives_lower_than_unmatched: true
        force_match_for_each_row: true
        use_matmul_gather: true
      }
    }
    similarity_calculator {
      iou_similarity {
      }
    }
    box_predictor {
      weight_shared_convolutional_box_predictor {
        conv_hyperparams {
          regularizer {
            l2_regularizer {
              weight: 3.9999998989515007e-05
            }
          }
          initializer {
            random_normal_initializer {
              mean: 0.0
              stddev: 0.009999999776482582
            }
          }
          activation: RELU_6
          batch_norm {
            decay: 0.996999979019165
            scale: true
            epsilon: 0.0010000000474974513
          }
        }
        depth: 128
        num_layers_before_predictor: 4
        kernel_size: 3
        class_prediction_bias_init: -4.599999904632568
        share_prediction_tower: true
        use_depthwise: true
      }
    }
    anchor_generator {
      multiscale_anchor_generator {
        min_level: 3
        max_level: 7
        anchor_scale: 4.0
        aspect_ratios: 1.0
        aspect_ratios: 2.0
        aspect_ratios: 0.5
        scales_per_octave: 2
      }
    }
    post_processing {
      batch_non_max_suppression {
        score_threshold: 9.99999993922529e-09
        iou_threshold: 0.6000000238418579
        max_detections_per_class: 100
        max_total_detections: 100
        use_static_shapes: false
      }
      score_converter: SIGMOID
    }
    normalize_loss_by_num_matches: true
    loss {
      localization_loss {
        weighted_smooth_l1 {
        }
      }
      classification_loss {
        weighted_sigmoid_focal {
          gamma: 2.0
          alpha: 0.25
        }
      }
      classification_weight: 1.0
      localization_weight: 1.0
    }
    encode_background_as_zeros: true
    normalize_loc_loss_by_codesize: true
    inplace_batchnorm_update: true
    freeze_batchnorm: false
  }
}
train_config {
  batch_size: 8
  data_augmentation_options {
    random_horizontal_flip {
    }
  }
  data_augmentation_options {
    random_crop_image {
      min_object_covered: 0.0
      min_aspect_ratio: 0.75
      max_aspect_ratio: 3.0
      min_area: 0.75
      max_area: 1.0
      overlap_thresh: 0.0
    }
  }
  sync_replicas: true
  optimizer {
    momentum_optimizer {
      learning_rate {
        cosine_decay_learning_rate {
          learning_rate_base: 0.07999999821186066
          total_steps: 50000
          warmup_learning_rate: 0.026666000485420227
          warmup_steps: 1000
        }
      }
      momentum_optimizer_value: 0.8999999761581421
    }
    use_moving_average: false
  }
  fine_tune_checkpoint: "pre-trained-models/ssd_mobilenet_v2_fpnlite_640x640_coco17_tpu-8/checkpoint/ckpt-0"  #Change this path to that of pretrained model
  num_steps: 50000
  startup_delay_steps: 0.0
  replicas_to_aggregate: 8
  max_number_of_boxes: 100
  unpad_groundtruth_tensors: false
  fine_tune_checkpoint_type: "detection" #Set this to detection
  fine_tune_checkpoint_version: V2
}
train_input_reader {
  label_map_path: "annotations/label_map.pbtxt"  #Path to label map
  tf_record_input_reader {
    input_path: "annotations/train.record"  #Path to train record file
  }
}
eval_config {
  metrics_set: "coco_detection_metrics"
  use_moving_averages: false
}
eval_input_reader {
  label_map_path: "annotations/label_map.pbtxt"  #Path to label map
  shuffle: false
  num_epochs: 1
  tf_record_input_reader {
    input_path: "annotations/test.record"       #Path to test record file
  }
}

Note that label_map_path and input_path have to be modified for both train_input_reader and eval_input_reader. Both can use the same label_map_path but input_path should point to train.record and test.record respectively. All paths should be absolute or relative to the scripts folder.

需要注意的是label_map_pathinput_path必须修改两个train_input_readereval_input_reader。 两者都可以使用相同的label_map_path,但是input_path应该分别指向train.recordtest.record 。 所有路径都应该是绝对路径或相对于scripts文件夹的路径。

培训与评估 (Training and evaluation)

训练 (Training)

Now that we have pre-processed our dataset and configured our training pipeline, let’s get to training our model. Inside the scripts folder, you will find model_main_tf2.py file. This code will be used to train our model.

现在,我们已经预处理了数据集并配置了训练管道,让我们开始训练模型。 在脚本文件夹中,您会找到model_main_tf2.py文件。 此代码将用于训练我们的模型。

python3 model_main_tf2.py 
--model_dir = <MODEL PATH>
--pipeline_config_path = <CONFIG PATH>
--checkpoint_dir= <CHECKPOINT PATH>

Here replace

在这里替换

<MODEL PATH> — with the location of the modelname folder.

<MODEL PATH> —带有modelname文件夹的位置。

<CONFIG PATH>- with the location of the pipeline.config file inside the modelname folder.

<CONFIG PATH>-以及modelname文件夹中pipeline.config文件的位置。

<CHECKPOINT PATH>- with the location of the modelname folder.

<CHECKPOINT PATH>-以及modelname文件夹的位置。

The model should start training on the above command. While it is training, It will evaluate the model based on the latest checkpoint files in modelname and the results are saved as events.out.tfevents.* files inside modelname/train. These files can be used to monitor the model performance in Tensorboard as shown in the next step.

模型应该开始对以上命令进行训练。 在训练过程中,它将基于modelname中的最新检查点文件评估模型,并将结果另存为modelname / train中的 events.out.tfevents。*文件。 这些文件可用于监视Tensorboard中的模型性能,如下一步所示。

评价 (Evaluation)

Tensorboard is a feature of Tensorflow that allows us to monitor our model’s performance. This can be used to analyze is the model is over-fitting or under-fitting or if it is learning anything at all. We can use our generated events.out.tfevents.* files inside modelname/train with Tensorboard to monitor our model’s performance.

Tensorboard是Tensorflow的一项功能,它使我们能够监控模型的性能。 这可以用于分析模型是否过度拟合或拟合不足,或者是否正在学习任何东西。 我们可以在Tensorboard中使用我们在modelname / train中生成的events.out.tfevents。*文件来监视模型的性能。

To whip up Tensorboard, run the following command from within the Project folder.

要启动Tensorboard,请在Project文件夹中运行以下命令。

tensorboard --logdir=models/modelname

If everything went well, the following message should appear.

如果一切顺利,则将出现以下消息。

TensorBoard 2.2.2 at http://localhost:6006/

Now open up http://localhost:6006/ on your browser to see the training metrics on the tensorboard as the model trains.

现在打开http:// localhost:6006 / 在您的浏览器上查看模型训练时在张量板上的训练指标。

导出模型 (Exporting the model)

Now that we have trained our data to suit our requirements, we have to export this model for use in our desired applications. Inside the scripts folder, you will find exporter_main_v2.py file. This code will be used to export our model.

现在我们已经训练了数据以适合我们的需求,我们必须导出此模型以用于所需的应用程序中。 在脚本文件夹中,您将找到exporter_main_v2.py文件。 此代码将用于导出我们的模型。

python3 exporter_main_v2.py --input_type image_tensor --pipeline_config_path <CONFIG PATH> --trained_checkpoint_dir <CHECKPOINT PATH> --output_directory <OUTPUT PATH>

Here replace

在这里替换

<CONFIG PATH>- with the location of the pipeline.config file inside the modelname folder.

<CONFIG PATH>-以及modelname文件夹中pipeline.config文件的位置。

<CHECKPOINT PATH>- with the location of the modelname folder.

<CHECKPOINT PATH>-以及modelname文件夹的位置。

<OUTPUT PATH>- with the path of a folder where you want to save the trained model. You can create a sub-folder within the exported models folder to save the trained model and give the location of this folder here.

<OUTPUT PATH>-包含要保存训练后的模型的文件夹的路径。 您可以在导出的模型文件夹中创建一个子文件夹,以保存经过训练的模型,并在此处提供此文件夹的位置。

That’s it! You now have a model retrained to suit your exact needs.

而已! 现在,您已经对模型进行了重新培训,以适应您的确切需求。

As I mentioned in the introduction, I do not own any of these code. All this code is already available on the internet and I just made some tweaks to get them working. I’m thankful to all the developers who made my life easy.

正如我在简介中所述,我不拥有任何这些代码。 所有这些代码已经可以从Internet上获得,我做了一些调整以使它们工作。 我感谢所有使我的生活变得轻松的开发人员。

This was my first article so leave your suggestions for improvement. Feel free to email me or ping me on LinkedIn with doubts or suggestions.

这是我的第一篇文章,所以留下您的改进建议。 如有任何疑问或建议,请随时给我发送电子邮件或在LinkedIn上向我ping。

Peace✌️

和平✌️

翻译自: https://medium.com/swlh/creating-your-own-custom-object-detector-using-transfer-learning-f26918697889

自定义敏感词检测器

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值