Ask Your Question

VigneshSuresh's profile - activity

2020-06-16 23:50:00 -0600 asked a question I am getting the error. this is training code for training the model to identify short hair long hair and bald.

I am getting the error. this is training code for training the model to identify short hair long hair and bald. # USAGE

2020-05-07 20:50:51 -0600 asked a question Is there a package or module in python for xray scanning???

Is there a package or module in python for xray scanning??? I am new to python programming and have explored only a few

2020-04-01 01:05:02 -0600 asked a question Sqlite3 to excel export error. Help Appreciated.

Sqlite3 to excel export error. Help Appreciated. I get this after export C:\fakepath\PICT1.png I want this as the output

2020-03-16 11:20:30 -0600 asked a question I am getting an Index out of range Error. I am retreiving the names from sqlite3 into a list. I think the retrieval is not proper. Please help

I am getting an Index out of range Error. I am retreiving the names from sqlite3 into a list. I think the retrieval is

2020-03-14 02:37:55 -0600 marked best answer This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

The error is:-

Traceback (most recent call last):
  File "C:\Users\ACER\Desktop\PROJECT ALL RESOURCE\Implementation\PYTHON FILES\training_set.py", line 34, in <module>
    Ids, faces = getImagesWithID('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/Implementation/PYTHON FILES/DataSets')                                              # Calling the function
  File "C:\Users\ACER\Desktop\PROJECT ALL RESOURCE\Implementation\PYTHON FILES\training_set.py", line 22, in getImagesWithID
    cv2.imwrite('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/Implementation/PYTHON FILES/Training Images/training.jpg', alignedFace)
cv2.error: OpenCV(4.2.0) C:\projects\opencv-python\opencv\modules\imgcodecs\src\loadsave.cpp:715: error: (-215:Assertion failed) !_img.empty() in function 'cv::imwrite'

and the code:

import os                                                                       # import for taking the imagePaths
import cv2                                                                      # openCV
import numpy as np                                                              # for numpy arrays
from PIL import Image                                                           # pillow
import openface
dlibFacePredictor = 'shape_predictor_68_face_landmarks.dat'                     # Path to dlib's face predictor
recognizer = cv2.face.LBPHFaceRecognizer_create()                                     # Local Binary Patterns Histograms
imgDim = 96                                                                     # Default image dimension
align = openface.AlignDlib(dlibFacePredictor)

def getImagesWithID(path):
    imageFolders = [os.path.join(path, f) for f in os.listdir(path)]    # Joining './dataset' and '<image names>'
    faces = []                                                                  # Empty array for faces
    Ids = []
    for imageFolder in imageFolders:
        imagePaths = [os.path.join(imageFolder, f) for f in os.listdir(imageFolder)]
        for imagePath in imagePaths:
            image = cv2.imread(imagePath)
            rgbImg = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
            bb = align.getLargestFaceBoundingBox(rgbImg)
            alignedFace = align.align(imgDim, rgbImg, bb=None, landmarkIndices=openface.AlignDlib.OUTER_EYES_AND_NOSE)
            cv2.imwrite('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/Implementation/PYTHON FILES/Training Images/training.jpg', alignedFace)
            faceImg = Image.open('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/Implementation/PYTHON FILES/Training Images/training.jpg').convert('L')        # Converting colored and GrayScale images into bilevel images using Floyd-Steinberg dither
            faceNp = np.array(faceImg, 'uint8')                                     # Converting face array into numpy array
            ID = int(os.path.split(imagePath)[-1].split('.')[1])                    # Check this again
            faces.append(faceNp)                                                    # adding the dilevel face into faces array
            Ids.append(ID)                                                          # index of ID and faceNp is same in both arrays
            cv2.imshow("Training", faceNp)                                          # Showing the faces which are getting trained
            cv2.waitKey(10)
                                                                        # Empty array for Person Ids
                                                             # Waiting time id 10 milisecond
    return Ids, faces

Ids, faces = getImagesWithID('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/Implementation/PYTHON FILES/DataSets')                                              # Calling the function
recognizer.train(faces, np.array(Ids))                                          # Training the faces
recognizer.save('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/Implementation/PYTHON FILES/Training/trainingData.yml')                                # Saving the yml file
cv2.destroy()                                                         # Closing all the opened windows
2020-03-03 21:41:29 -0600 commented question Help appreciated. This is the error i get after executing the code. i use openpyxl 3.0.3

OpenCV is 4.2.0 which I use. I use openpyxl 3.3.0 which is latest version

2020-03-03 10:26:32 -0600 commented question Help appreciated. This is the error i get after executing the code. i use openpyxl 3.0.3

Sir, the pypi.org also says openpyxl latest version is 3.0.3 and you say it is oldest. If yes, please tell from where sh

2020-03-03 00:25:33 -0600 asked a question Help appreciated. This is the error i get after executing the code. i use openpyxl 3.0.3

Help appreciated. This is the error i get after executing the code. i use openpyxl 3.0.3 for row in range(2, (len(sheet.

2020-03-01 05:48:55 -0600 asked a question This is a code for recognition of faces and attendance marking. I get the following error

Help needed urgently. This is a code for recognition of faces and attendance marking. I get the following error import c

2020-02-23 00:13:36 -0600 received badge  Editor (source)
2020-02-23 00:13:36 -0600 edited question This is my code for recognition of faces. I am getting the following error

This is my code for recognition of faces. I am getting the following error align = openface.AlignDlib(dlibFacePredictor)

2020-02-23 00:11:38 -0600 asked a question This is my code for recognition of faces. I am getting the following error

This is my code for recognition of faces. I am getting the following error align = openface.AlignDlib(dlibFacePredictor)

2020-02-16 10:27:44 -0600 commented question This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

Can u provide me some solution to it. It will be helpful

2020-02-16 05:55:29 -0600 commented question This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

align(imgDim, rgbImg, bb=None, landmarks=None, landmarkIndices=INNER_EYES_AND_BOTTOM_LIP) Transform and align a face in

2020-02-16 05:55:03 -0600 commented question This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

align(imgDim, rgbImg, bb=None, landmarks=None, landmarkIndices=INNER_EYES_AND_BOTTOM_LIP)

2020-02-16 05:54:55 -0600 commented question This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

align(imgDim, rgbImg, bb=None, landmarks=None, landmarkIndices=INNER_EYES_AND_BOTTOM_LIP)[source]

2020-02-16 05:54:24 -0600 commented question This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

I did not get it. please help me sir

2020-02-16 05:35:47 -0600 asked a question This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated

This is a code to train a dataset of faces captured using OpenCV in python. I get error like this. Help appreciated impo

2020-02-15 10:54:40 -0600 asked a question This is my code. I use Python 3.6.8 and opencv 4.2.0

This is my code. I use Python 3.6.8 and opencv 4.2.0 import os