b52e68760b6ba903ac0a95c009144fb55b9e27ca,darkflow/net/yolo/predict.py,,postprocess,#Any#Any#Any#Any#,76

Before Change


					""confidence": %.2f,"
					""topleft": {"x": %d, "y": %d},"
					""bottomright": {"x": %d,"y": %d}},\n") % \
					(mess, confidence, left, top, right, bot)
			textBuff += line
			continue

		cv2.rectangle(imgcv,
			(left, top), (right, bot),

After Change


	else: imgcv = im

	h, w, _ = imgcv.shape
	resultsForJSON = []
	for b in boxes:
		boxResults = self.process_box(b, h, w, threshold)
		if boxResults is None:
			continue
		left, right, top, bot, mess, max_indx, confidence = boxResults
		thick = int((h + w) // 300)
		if self.FLAGS.json:
			resultsForJSON.append({"label": mess, "confidence": float("%.2f" % confidence), "topleft": {"x": left, "y": top}, "bottomright": {"x": right, "y": bot}})
			continue

		cv2.rectangle(imgcv,
			(left, top), (right, bot),
			self.meta["colors"][max_indx], thick)
		cv2.putText(
			imgcv, mess, (left, top - 12),
			0, 1e-3 * h, self.meta["colors"][max_indx],
			thick // 3)


	if not save: return imgcv

	outfolder = os.path.join(self.FLAGS.imgdir, "out")
	img_name = os.path.join(outfolder, os.path.basename(im))
	if self.FLAGS.json:
		textJSON = json.dumps(resultsForJSON)
		textFile = os.path.splitext(img_name)[0] + ".json"
		with open(textFile, "w") as f:
			f.write(textJSON)
		return	
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: thtrieu/darkflow
Commit Name: b52e68760b6ba903ac0a95c009144fb55b9e27ca
Time: 2017-06-29
Author: abagshaw@hotmail.ca
File Name: darkflow/net/yolo/predict.py
Class Name:
Method Name: postprocess


Project Name: pantsbuild/pants
Commit Name: 882042b5e7f6f04c3c00105f5ac56a5e5c76252c
Time: 2020-05-07
Author: benjyw@gmail.com
File Name: src/python/pants/core/project_info/list_roots_test.py
Class Name: RootsTest
Method Name: test_multiple_source_roots


Project Name: thtrieu/darkflow
Commit Name: b52e68760b6ba903ac0a95c009144fb55b9e27ca
Time: 2017-06-29
Author: abagshaw@hotmail.ca
File Name: darkflow/net/yolov2/predict.py
Class Name:
Method Name: postprocess


Project Name: pantsbuild/pants
Commit Name: 882042b5e7f6f04c3c00105f5ac56a5e5c76252c
Time: 2020-05-07
Author: benjyw@gmail.com
File Name: src/python/pants/core/project_info/list_roots_test.py
Class Name: RootsTest
Method Name: test_single_source_root