How to use the nudenet.detector.Detector function in nudenet

To help you get started, we’ve selected a few nudenet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bedapudi6788 / NudeNet / nudenet / detector.py View on Github external
for box in boxes:
            part = image[box[1]:box[3], box[0]:box[2]]
            image = cv2.rectangle(image, (box[0], box[1]), (box[2], box[3]), (0, 0, 0), cv2.FILLED)
            # image = cv2.GaussianBlur(part,(23, 23), 30)
            # image[box[1]:box[3], box[0]:box[2]] = part
        
        if visualize:
            cv2.imshow("Blurred image", image)
            cv2.waitKey(0)
        
        if out_path:
            cv2.imwrite(out_path, image)


if __name__ == '__main__':
    m = Detector('/Users/bedapudi/Desktop/inference_resnet50_csv_14.h5')
    print(m.censor('/Users/bedapudi/Desktop/n2.jpg', out_path='a.jpg'))