Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze Mask-RCNN in TensorFlow 8

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to analyze Mask-RCNN in TensorFlow 8, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

Today we will learn how to use Mask R-CNN to achieve instance segmentation.

Q & A

Q1. What is Mask R-CNN?

A: Mask R-CNN is an algorithm for instance segmentation.

Q2. What is instance segmentation?

A: instance segmentation is to show the specific category to which the target belongs on each pixel.

The difficulty of case segmentation lies in the correct detection of all the targets in an image and the segmentation of each example. The purpose of detection is to classify each single target and then calibrate it with bounding box, while the purpose of case segmentation is to distinguish each pixel into a different classification without distinguishing different targets.

Text

one。 Environmental preparation

This article describes how to use Mask-RCNN to achieve pedestrian detection, assuming that you already know something about SSD, YOLO, Faster RCNN and other frameworks.

1. Prepare the TensorFlow environment

Tensorflow (> = 1.0.0)

Numpy

2. Gtihub code

Code download: https://github.com/CharlesShang/FastMaskRCNN

3. Download CoCo data

Download address: http://http://cocodataset.org/#download

Web download is slow. You can download it from my network disk: https://pan.baidu.com/s/1jHJdlVg#list/path=%2F

4. Download ReNet50

Wget http://download.tensorflow.org/models/resnet_v1_50_2016_08_28.tar.gz

Decompress to get resnet_v1_50.ckpt

two。 Code compilation and running

You can refer to Github for code compilation. The following process is also given here:

1. Make coco tool

Cd. / libs/datasets/pycocotools make

two。 Put the downloaded COCO data into the. / data directory and convert the data into the format required by tf

Follow the instructions:

A) create a coco folder under data and copy the specified five files to that directory

B) extract the zip file

C) create an output/mask_rcnn folder under the root directory to store the log

D) execute the format conversion script (it will take about an hour)

Python download_and_convert_data.py

It may prompt Python for some library errors. It doesn't matter. Just install it. You can replace the pip source with a domestic pip install-I https://pypi.tuna.tsinghua.edu.cn/simple pil.

Sudo pip install pil # or python-m pip install Pillow

Sudo pip install scikit-image sudo apt-get install python3-tk

3. Resnet model trained in advance

Create a new pretrained_models directory under data and put resnet_v1_50.ckpt under the directory.

4. Make compilation

Cd. / libs make

5. Training data

Python.. / train/train.py

When you observe Loss, it shows that the training process has begun successfully. Don't worry, wait for the Loss to decrease slowly. The original author spent 32 hours training 8-GPU.

three。 Training effect

According to the Log file generated by the training, store it in output:

Set the logdir of TensorBoard to see the training effect:

You can see the changes in the entire loss, there is still a sense of achievement, it needs to be explained that there may be shocks in the loss during the training process, it does not matter, just wait until the gradual decline.

Take a look at the generated Graphs:

four。 Demo operation

The running method of Demo is not given on Github, so we need to find our own script to implement it.

Here the author will not give a specific code, please play by yourselves.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report