### 文章目录

 这两年开始毕业设计和毕业答辩的要求和难度不断提升，传统的毕设题目缺少创新和亮点，往往达不到毕业答辩的要求，这两年不断有学弟学妹告诉学长自己做的项目系统达不到老师的要求。

 **基于深度学习的行人重识别算法研究与实现 **

磊学长这里给一个题目综合评分(每项满分5分)

## 3 行人检测

```①==>40×40×255
②==>20×20×255
③==>10×10×255```

```class Yolo(object):
def __init__(self, weights_file, verbose=True):
self.verbose = verbose
# detection params
self.S = 7  # cell size
self.B = 2  # boxes_per_cell
self.classes = ["aeroplane", "bicycle", "bird", "boat", "bottle",
"bus", "car", "cat", "chair", "cow", "diningtable",
"dog", "horse", "motorbike", "person", "pottedplant",
"sheep", "sofa", "train","tvmonitor"]
self.C = len(self.classes) # number of classes
# offset for box center (top left point of each cell)
self.x_offset = np.transpose(np.reshape(np.array([np.arange(self.S)]*self.S*self.B),
[self.B, self.S, self.S]), [1, 2, 0])
self.y_offset = np.transpose(self.x_offset, [1, 0, 2])
self.threshold = 0.2  # confidence scores threhold
self.iou_threshold = 0.4
#  the maximum number of boxes to be selected by non max suppression
self.max_output_size = 10
self.sess = tf.Session()
self._build_net()
self._build_detector()

## 4 行人重识别

Reid提取特征

#### 相关代码

```# features:reid模型输出512dim特征
person_cossim = cosine_similarity(features, self.query_feat)
max_idx = np.argmax(person_cossim, axis=1)
maximum = np.max(person_cossim, axis=1)
max_idx[maximum < 0.6] = -1
score = maximum
reid_results = max_idx
draw_person(ori_img, xy, reid_results, self.names)  # draw_person name```

## 5 其他工具

OpenCV

```import cv2
import numpy as np
cv_img = cv2.imdecode(np.fromfile(filePath,dtype=np.uint8), -1)
return cv_img
# 需要可视化的图片地址
img_path = ‘’
# 对应图片的检测结果
detection_result = []