def get_frames(query_path, video_base_path): query_array = [] video = cv2.VideoCapture(query_path) fps = video.get(cv2.CAP_PROP_FPS) got_frame = True while got_frame: got_frame, frame = video.read() if frame is None: break width = len(frame[0]) height = len(frame) if height == 0 or width == 0: break if width < height: frame = np.rot90(frame, 1) query_array.append(frame) query_array_localized = Localization.find_screen(query_array, fps) Recognize.recognize(query_array_localized, video_base_path, fps)
def PlateRecognize(img, model): try: #Tìm biển số xe img = PlateDetect.MainProcess(img) list_Of_Char_Img,All_Char_Img = CharacterSegment.MainProcess(img) cv2.imshow(" ",All_Char_Img) cv2.waitKey(0) #Labeling.Labeling(list_Of_Char_Img) list_Of_Char = Recognize.char_predict(list_Of_Char_Img, model) return list_Of_Char except: return None
def Recognizer(Function): A = Recognize.vocabulary(Function).pop() #A = Recognize.vocabulary(Function) A = A[2:len(A) - 2] table = [] table = A.split('], [') TrTable = [] row = [] for i in table: row = i.split(', ') TrTable.append(row) return TrTable
def Recognizer( Function, task ): #возвращает таблицу истинности введённой функции, парсит в список OPNames = Recognize.vocabulary(Function, task) if (OPNames[0] == -1): return OPNames A = OPNames.pop() A = A[2:len(A) - 2] table = [] table = A.split('], [') TrTable = [] row = [] for i in table: row = i.split(', ') TrTable.append(row) return TrTable
def read(): """Save lats image and recognize the image""" global other # top 5 perdiction path = 'test.jpg' image.save(path) # recognize the character in the image top1, top5 = Recognize.recognize(path, model) other = [] mapping = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabdefghnqrt' text_1.insert(END, mapping[top1]) for val in top5[1:]: other.append(mapping[val]) button_3['text'] = mapping[top5[1]] button_4['text'] = mapping[top5[2]] button_5['text'] = mapping[top5[3]] button_6['text'] = mapping[top5[4]] w.delete('all') # clear canvas draw.rectangle((0, 0, 400, 400), fill='black') # clear the image
import Recognize as R import closure_1978 as Main if __name__ == '__main__': R.main('./lang/js/grammar/javascript.fbjson', './lang/js/bugs/closure.1978.js', Main.my_predicate)
#Populate 'database' folder with the dataset of images to be recognize from import Recognize recognizer = Recognize.Recognize() #recognize takes path to the image to be recognized recognizer.recognize('011.jpg')
import Recognize as R import find_93623752 as Main if __name__ == '__main__': R.main('./lang/find/grammar/grammar.json', './lang/find/bugs/find.93623752', Main.my_predicate)
import os # accessing the os functions import check_camera import Capture_Image import Train_Image import Recognize Recognize.recognize_attendence()
import Recognize as R import grep_9c45c193 as Main if __name__ == '__main__': R.main('./lang/grep/grammar/grammar.json', './lang/grep/bugs/grep.9c45c193', Main.my_predicate)
def RecognizeFaces(): res = Recognize.recognize_attendence() message2.configure(text=res)
def RecognizeFaces(): Recognize.recognize_attendence() key = input("Nhap phim bat ky de tro lai main menu") mainMenu()
import Recognize as R import grep_54d55bba as Main if __name__ == '__main__': R.main('./lang/grep/grammar/grammar.json', './lang/grep/bugs/grep.54d55bba', Main.my_predicate)
def markattend(): #os.system("py Recognize.py") Recognize.recognize_attendence()
def student_page(): Recognize.recognize_attendence() return render_template('student_page.html')
import Recognize as R import grep_3c3bdace as Main if __name__ == '__main__': R.main('./lang/grep/grammar/grammar.json', './lang/grep/bugs/grep.3c3bdace', Main.my_predicate)
def rfaces_call(): tkStatus.set("Recognizing Faces...") status_label.update() Recognize.recognize_attendence() tkStatus.set("Faces Recognized.") status_label.update()
import Recognize as R import rhino_386 as Main import sys if __name__ == '__main__': R.main('./lang/js/grammar/javascript.fbjson', './lang/js/bugs/rhino.386.js', Main.my_predicate)
import Recognize as R import find_c8491c11 as Main if __name__ == '__main__': R.main('./lang/find/grammar/grammar.json', './lang/find/bugs/find.c8491c11', Main.my_predicate)
def recognize(self): import Recognize Recognize.recognize_face(self)
import Recognize as R import find_dbcb10e9 as Main if __name__ == '__main__': R.main('./lang/find/grammar/grammar.json', './lang/find/bugs/find.dbcb10e9', Main.my_predicate)
import Recognize as R import lua_5_3_5__4 as Main import sys if __name__ == '__main__': R.main('./lang/lua/grammar/lua.fbjson', './lang/lua/bugs/4.lua', Main.my_predicate)
import Recognize as R import find_07b941b1 as Main if __name__ == '__main__': R.main('./lang/find/grammar/grammar.json', './lang/find/bugs/find.07b941b1', Main.my_predicate)
import Recognize as R import clojure_2518 as Main if __name__ == '__main__': R.main('./lang/clojure/grammar/clojure.fbjson', './lang/clojure/bugs/clj-2518.clj', Main.my_predicate)
img = cv2.resize(img,(600,h)) return img except: return None def PlateRecognize(img, model): try: #Tìm biển số xe img = PlateDetect.MainProcess(img) list_Of_Char_Img,All_Char_Img = CharacterSegment.MainProcess(img) cv2.imshow(" ",All_Char_Img) cv2.waitKey(0) #Labeling.Labeling(list_Of_Char_Img) list_Of_Char = Recognize.char_predict(list_Of_Char_Img, model) return list_Of_Char except: return None Constant.image_file = 'Test1.jpg' #Load hình ảnh từ file lên #31,33 loi #Test28 1430 model = Recognize.getModelStruct() img = ReadAndResize(Constant.image_file) list_Of_Char = PlateRecognize(img, model) print(list_Of_Char) cv2.waitKey(0)
def RecognizeFaces(): Recognize.recognize_attendence() input("Enter any key to return main menu") mainMenu()
def recognizefaces(): Recognize.recognize_attendence()