first commit
Bu işleme şunda yer alıyor:
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"lang":"en",
|
||||||
|
"name":"model",
|
||||||
|
"version":"0.0.0",
|
||||||
|
"spacy_version":">=2.3.5",
|
||||||
|
"description":"",
|
||||||
|
"author":"",
|
||||||
|
"email":"",
|
||||||
|
"url":"",
|
||||||
|
"license":"",
|
||||||
|
"spacy_git_version":"1d4b1dea2",
|
||||||
|
"vectors":{
|
||||||
|
"width":0,
|
||||||
|
"vectors":0,
|
||||||
|
"keys":0,
|
||||||
|
"name":"spacy_pretrained_vectors"
|
||||||
|
},
|
||||||
|
"pipeline":[
|
||||||
|
"ner"
|
||||||
|
],
|
||||||
|
"factories":{
|
||||||
|
"ner":"ner"
|
||||||
|
},
|
||||||
|
"labels":{
|
||||||
|
"ner":[
|
||||||
|
"Address",
|
||||||
|
"Last Name"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"beam_width":1,
|
||||||
|
"beam_density":0.0,
|
||||||
|
"beam_update_prob":1.0,
|
||||||
|
"cnn_maxout_pieces":3,
|
||||||
|
"nr_feature_tokens":6,
|
||||||
|
"nr_class":10,
|
||||||
|
"hidden_depth":1,
|
||||||
|
"token_vector_width":96,
|
||||||
|
"hidden_width":64,
|
||||||
|
"maxout_pieces":2,
|
||||||
|
"pretrained_vectors":null,
|
||||||
|
"bilstm_depth":0,
|
||||||
|
"self_attn_depth":0,
|
||||||
|
"conv_depth":4,
|
||||||
|
"conv_window":1,
|
||||||
|
"embed_size":2000
|
||||||
|
}
|
||||||
İkili dosya gösterilmiyor.
@@ -0,0 +1 @@
|
|||||||
|
�¥movesÙ {"0":{},"1":{"Address":-1,"Last Name":-2},"2":{"Address":-1,"Last Name":-2},"3":{"Address":-1,"Last Name":-2},"4":{"":1,"Address":-1,"Last Name":-2},"5":{"":1}}
|
||||||
Dosya farkları bir veya daha fazla satır çok uzun olduğundan bastırıldı
@@ -0,0 +1 @@
|
|||||||
|
�
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
�«lexeme_norm€
|
||||||
Dosya farkı çok büyük olduğundan ihmal edildi
Fark Yükle
İkili dosya gösterilmiyor.
Dosya farkı çok büyük olduğundan ihmal edildi
Fark Yükle
Dosya farkları bir veya daha fazla satır çok uzun olduğundan bastırıldı
@@ -0,0 +1,66 @@
|
|||||||
|
OrganizationName,OrganizationEmail,Designation,OrganizationPhoneNumber,ContactPersonName,Email,Url,CIN,PhoneNumber,PhoneNumber1,PhoneNumber2,Address,AddressLine1_1,AddressLine2_1,country_code,LandMark1,PinCode1,Source,Industry,AddressName2,AddressLine1_2,AddressLine2_2,LandMark2,PinCode2,LOB,TAGS,PortalName,CityName1,CityName2,Assigned To,values,values.1,Values,
|
||||||
|
RICHWORTH,,SENIOR SALES ASSOCIATE ,,N. PORCHEZHIYAN ,sales@richworth.in,,,9551272626,914442125566,,"Clothing, 15 Arcot Street, T. Nagar, Chennai , , 600017",,,IN,"Thygarayanagar South NDS.O, Hindi Prachar Sabha, Thygarayanagar North ND, Thygarayanagar H.O",600017,,,,,,,,,,,Chennai,,,,,,
|
||||||
|
SRIKRISHNAPOLYMERS,,DIRECTOR - SALES & BUSINESS DEVELOPMENT ,,Sameer ,sameer@srikrishnapolymers.in,,,+919063007351,,,">, 91 9063 007 351 sameer@srikrishnapolymers.in www.srikrishnapolymers.in Re. [ > # 8-4-101/59, Mailerdevpally, Rajendra Nagar NS Hyderabad. , , 500077",,,IN,Kattedan Ie,500077,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
SRIKRISHNAPOLYMERS,,DIRECTOR - SALES & BUSINESS DEVELOPMENT ,,Sameer ,sameer@srikrishnapolymers.in,,,+919063007351,,,">, 91 9063 007 351 sameer@srikrishnapolymers.in www.srikrishnapolymers.in Re. [ > # 8-4-101/59, Mailerdevpally, Rajendra Nagar NS Hyderabad. , , 500077",,,IN,Kattedan Ie,500077,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
SRIKRISHNAPOLYMERS,,DIRECTOR - SALES & BUSINESS DEVELOPMENT ,,Sameer ,sameer@srikrishnapolymers.in,,,+919063007351,,,">, 91 9063 007 351 sameer@srikrishnapolymers.in www.srikrishnapolymers.in Re. [ > # 8-4-101/59, Mailerdevpally, Rajendra Nagar NS Hyderabad. , , 500077",,,IN,Kattedan Ie,500077,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
APEXELEVATORSHYD,,,,P.Ramakrishna,ramakrishnaapexelevators@gmai.com,,,9959977066,9963110797,,Passenger,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
APEXELEVATORSHYD,,,,P.Ramakrishna,ramakrishnaapexelevators@gmai.com,,,9959977066,9963110797,," Hospital, Hydraulic etc. Nagole XRoad, Manatha Nagar, Plot No. 43, Road No. 1, Hyderabad Website:www.apexelevatorshyd.com E mail:ramakrishnaapexelevators@gmai.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,"R.O.PLANTS, SPARES &SERVICE",,"Mfrs.: Automatic Form Fill &Seal Machines, Coding Machines",info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,"R.O.PLANTS, SPARES &SERVICE",,IcON,info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,"R.O.PLANTS, SPARES &SERVICE",,"Mfrs.: Automatic Form Fill &Seal Machines, Coding Machines",info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,"Mfrs.: Automatic Form Fill &Seal Machines, Coding Machines",info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,"Mfrs.: Automatic Form Fill &Seal Machines, Coding Machines",info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,"Mfrs.: Automatic Form Fill &Seal Machines, Coding Machines",info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,"Mfrs.: Automatic Form Fill &Seal Machines, Coding Machines",info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,,info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,K. Mahesh Goud,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,| ,naren_1968@yahoo.com,,,9724303106,,,"A-318, , , Vrindavan Flats, Nr. Vejalpur Police Chowki, Ahmedabad-55",,,,,55,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,| ,naren_1968@yahoo.com,,,9724303106,,,"A-318, , , Vrindavan Flats, Nr. Vejalpur Police Chowki, Ahmedabad-55",,,,,55,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,N. D. Singh 1 ,naren_1968@yahoo.com,,,9724303106,,,"A-318, , , Vrindavan Flats, Nr. Vejalpur Police Chowki, Ahmedabad-55",,,,,55,,,,,,,,,,,,,,,,,
|
||||||
|
RICHWORTH,,SENIOR SALES ASSOCIATE ,,N. PORCHEZHIYAN ,sales@richworth.in,,,9551272626,914442125566,,"Clothing, 15 Arcot Street, T. Nagar, Chennai , , 600017",,,IN,"Thygarayanagar South NDS.O, Hindi Prachar Sabha, Thygarayanagar North ND, Thygarayanagar H.O",600017,,,,,,,,,,,Chennai,,,,,,
|
||||||
|
,,,,KUSH JAISWAL ,jaiswalkush273@gmail.com,,,8919794310,,,"1-91-10, GSTIN No : 37ACJPJ5588R12Z1 Fssai : 20121038, , -530017",,,IN,"L B Colony, M.V.P.Colony",530017,,,,,,,,,,,Visakhapatnam,,,,,,
|
||||||
|
ECOLASTIC,,SALES&MARKETING,,D Madhusudhana,help@ecolastic.in,mrd@ecolastic.in,,,+919118699999,,,"Floor, Phase-1,Plot No.35/2,IDA, Cherlapally Hyderabac, Telangana, , , -500051",,,IN,Hindustan Cables Ltd,500051,,,,,,,,,,,Hyderabad,,,,,
|
||||||
|
ECOLASTIC,,SALES&MARKETING,,D Madhusudhana,"help@ecolastic.in, mrd@ecolastic.in",,,+919118699999,,,"Floor, Phase-1,Plot No.35/2,IDA, Cherlapally Hyderabac, Telangana, , , -500051",,,IN,Hindustan Cables Ltd,500051,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
RICHWORTH,,SENIOR SALES ASSOCIATE ,,N. PORCHEZHIYAN ,sales@richworth.in,,,9551272626,914442125566,,"Clothing, 15 Arcot Street, T. Nagar, Chennai , , 600017",,,IN,"Thygarayanagar South NDS.O, Hindi Prachar Sabha, Thygarayanagar North ND, Thygarayanagar H.O",600017,,,,,,,,,,,Chennai,,,,,,
|
||||||
|
SRIKRISHNAPOLYMERS,,DIRECTOR - SALES & BUSINESS DEVELOPMENT ,,Sameer ,sameer@srikrishnapolymers.in,,,+919063007351,,,">, 91 9063 007 351 sameer@srikrishnapolymers.in www.srikrishnapolymers.in Re. [ > # 8-4-101/59, Mailerdevpally, Rajendra Nagar NS Hyderabad. , , 500077",,,IN,Kattedan Ie,500077,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines, . Telangana, India. Cell:91338, , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines, . Telangana, India. Cell:91338, , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines, . Telangana, India. Cell:91338, , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines, . Telangana, India. Cell:91338, , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines, . Telangana, India. Cell:91338, , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines Coding Machines R.O.Plants, Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines, , . Telangana, India. Cell:91338, , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines Coding Machines R.O.Plants, Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad , , , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,," Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040. Telangana, India. Cell:91338772222, E-mail:info@iconpackagingmachineries.com Website: www.iconpackagingmachineries.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines Coding Machines R.O.Plants, Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad , , , , -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines Coding Machines R.O.Plants, Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines Coding Machines R.O.Plants, Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
SRIKRISHNAPOLYMERS,,DIRECTOR - SALES & BUSINESS DEVELOPMENT ,,Sameer ,sameer@srikrishnapolymers.in,,,+919063007351,,,">+919063007351 sameer@srikrishnapolymers.in www.srikrishnapolymers.in Re. [ >#8-4-101/59,Mailerdevpally,RajendraNagar NSHyderabad. 500077",,,IN,Kattedan Ie,500077,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
APEXELEVATORSHYD,,,,P.Ramakrishna,ramakrishnaapexelevators@gmai.com,,,9959977066,9963110797,," Hospital, Hydraulic etc. Nagole XRoad, Manatha Nagar, Plot No. 43, Road No. 1, Hyderabad Website:www.apexelevatorshyd.com E mail:ramakrishnaapexelevators@gmai.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
ECOLASTIC,,SALES&MARKETING,,D Madhusudhana,"help@ecolastic.in, mrd@ecolastic.in",,,+919118699999,,,"Floor Phase-1,Plot No.35/2,IDA, Cherlapally Hyderabac, Telangana , -500051",,,IN,Hindustan Cables Ltd,500051,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ECOLASTIC,,SALES&MARKETING,,D Madhusudhana,"help@ecolastic.in, mrd@ecolastic.in",,,+919118699999,,,"Floor Phase-1,Plot No.35/2,IDA, Cherlapally Hyderabac, Telangana , -500051",,,IN,Hindustan Cables Ltd,500051,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ICONPACKAGINGMACHINERIES,,,,K. Mahesh Goud,info@iconpackagingmachineries.com,,,+919177974444,,,"Machines Coding Machines R.O.Plants, Spares &Service H.No.5-2-571, Tirumala Nagar, Meerpet, HB Colony, Moula-Ali, Hyderabad -500 040",,,IN,"Ie Moulali, Aphb Colony Moulali",500040,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
ECOLASTIC,,SALES&MARKETING,,D Madhusudhana,"help@ecolastic.in, mrd@ecolastic.in",,,+919118699999,,,"Floor Phase-1,Plot No.35/2,IDA, Cherlapally Hyderabac, Telangana , -500051",,,IN,Hindustan Cables Ltd,500051,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
APEXELEVATORSHYD,,,,P.Ramakrishna,ramakrishnaapexelevators@gmai.com,,,9959977066,9963110797,," Hospital, Hydraulic etc. Nagole XRoad, Manatha Nagar, Plot No. 43, Road No. 1, Hyderabad Website:www.apexelevatorshyd.com E mail:ramakrishnaapexelevators@gmai.com ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
RICHWORTH,,SENIOR SALES ASSOCIATE ,,N. PORCHEZHIYAN ,sales@richworth.in,,,9551272626,914442125566,,"Clothing 15ArcotStreet,T.Nagar,Chennai 600017",,,IN,"Thygarayanagar South NDS.O, Hindi Prachar Sabha, Thygarayanagar North ND, Thygarayanagar H.O",600017,,,,,,,,,,,Chennai,,,,,,
|
||||||
|
,,,,N. D. Singh 1 ,naren_1968@yahoo.com,,,9724303106,,,"A-318VrindavanFlats,Nr.VejalpurPoliceChowki,Ahmedabad-55",,,,,55,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,KUSH JAISWAL ,jaiswalkush273@gmail.com,,,8919794310,,,"1-91-10, MIG-95,SECTOR-5,POSTALCOLONY,MVPCOLONY,VISAKHAPATNAN , -530017",,,IN,"L B Colony, M.V.P.Colony",530017,,,,,,,,,,,Visakhapatnam,,,,,,
|
||||||
|
,,,,L.K. Agarwal ,cargo_lifters@rediffmail.com,,,9848092514,,,"G-20 MinervaComplex,S.D.Road,Secunderabad- 500003",,,IN,"Secunderabad H.O, Kingsway",500003,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
AB TRADING CORPORATION ,,,,Sa ,,,,9848135926,9542650066,8142399179,"4-2-16 , MedipallyRoad,NTPC,Jyothinagar-, 505 215",,,IN,"A.P.Colony (Karim Nagar), Jyothinagar (Karim Nagar)",505215,,,,,,,,,,,Karim Nagar,,,,,,
|
||||||
|
,,,,KUSH JAISWAL ,jaiswalkush273@gmail.com,,,8919794310,,,"1-91-10, MIG-95,SECTOR-5,POSTALCOLONY,MVPCOLONY,VISAKHAPATNAM , -530017",,,IN,"L B Colony, M.V.P.Colony",530017,,,,,,,,,,,Visakhapatnam,,,,,,
|
||||||
|
APEXELEVATORSHYD,,,,P Ramakrishna ,ramakrishnaapexelevators@gmall,,,9959977066,9963110797,," Hospital, Hydraulic etc., Nagolé X Road, Manatha Nagar, Plot No. 43, Road No. 1, Hyderabad Website :. www.apexelevatorshyd.com ~~ ‘E-mail-: ‘ramakrishnaapexelevators@gmall com | i ",,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,L.K. Agarwal ,cargo_lifters@rediffmail.com,,,91-9848092514,,,"A—~~xIWS L.K.Agarwal 91 -9848092514 - + Cargo er40-27813957LiftersofIndia| —|+91 40-27810394 A a G4cargo_lifters@rediffmail.com ff aH j4 4 Se G-20,MinervaComplex,S.D.Road,Secunderabad- 500003",,,IN,"Secunderabad H.O, Kingsway",500003,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
SRIKRISHNAPOLYMERS,,DIRECTOR - SALES & BUSINESS DEVELOPMENT ,,Sameer ,sameer@srikrishnapolymers.in,,,+919063007351,,,"8-4-101/59 Mailerdevpally,RajendraNagar 3 ” Hyderabad. 500077",,,IN,Kattedan Ie,500077,,,,,,,,,,,Hyderabad,,,,,,
|
||||||
|
B TRADING CORPORATION ,,,,,,,,9848135926,9542650066,8142399179,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
SGS,,| MANAGER - KEY ACCOUNTS ,,Durga Prasad Akella ,a@sgs,,,+918976997839,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
COMPRESSOR LTD. ,,,,Falgun Pandya | MD ,,,,+919825032784,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
APEXELEVATORSHYD,,,,P Ramakrishna ,ramakrishnaapexelevators@gmall,,,9959977066,9963110797,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,KUSH JAISWAL ,jaiswalkush273@gmail.com,,,8919794310,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,KUSH JAISWAL ,jaiswalkush273@gmail.com,,,8919794310,,,"1-91-10, MIG-95,SECTOR-5,POSTALCOLONY,MVPCOLONY,VISAKHAPATNAM , -530017",,,IN,"L B Colony, M.V.P.Colony",530017,,,,,,,,,,,Visakhapatnam,,,,,,
|
||||||
|
,,,,KUSH JAISWAL ,jaiswalkush273@gmail.com,,,8919794310,,,"1-91-10, MIG-95,SECTOR-5,POSTALCOLONY,MVPCOLONY,VISAKHAPATNAM , -530017",,,IN,"L B Colony, M.V.P.Colony",530017,,,,,,,,,,,Visakhapatnam,,,,,,
|
||||||
|
,,SALES & SENIOR ENGINEER ,,MEHUL DEWDA ,info@19barvaya.com,,,+918160696665,+917802088493,,"A-607, DevashrayResidency,RTORoad,Vastral,Ahmedabad , -382418",,,IN,Vastral,382418,,,,,,,,,,,Ahmedabad,,,,,,
|
||||||
|
,,,,pe ,,,,8885009002,9676509851,9199285113, Be CE TEL ECP ,,,,,,,,,,,,,,,,,,,,,,
|
||||||
|
,,,,Kawalpreet Singh — ,"sardartoys@yahoo.com, Serdarjitoys3755@gmail.com",,,9256390000,9256360000,0161-2771586,"Chowk 6,2771626,5000222»Email -sardartoys@yahoo.comSARDARJITOYS=RaniJhenic!Poed. Ghumar Mandi,Ludhiana,Punjab- 141001",,,IN,"Ludhiana H.O, New Courts, Sarabha Nagar, P&t Colony (Ludhiana), Satsang Road, Ludhiana Kty, Durgapuri, Bharat Nagar (Ludhiana), Sidhpeeth",141001,,,,,,,,,,,Ludhiana,,,,,,
|
||||||
|
@@ -0,0 +1,13 @@
|
|||||||
|
Keys,Values
|
||||||
|
Address,"Chowk 6,2771626,5000222»Email -sardartoys@yahoo.comSARDARJITOYS=RaniJhenic!Poed. Ghumar Mandi,Ludhiana,Punjab- 141001"
|
||||||
|
PhoneNumber,9256390000
|
||||||
|
PhoneNumber1,9256360000
|
||||||
|
PhoneNumber2,0161-2771586
|
||||||
|
Email,"sardartoys@yahoo.com, Serdarjitoys3755@gmail.com"
|
||||||
|
PinCode1,141001
|
||||||
|
country_code,IN
|
||||||
|
LandMark1,"Ludhiana H.O, New Courts, Sarabha Nagar, P&t Colony (Ludhiana), Satsang Road, Ludhiana Kty, Durgapuri, Bharat Nagar (Ludhiana), Sidhpeeth"
|
||||||
|
state_name,Punjab
|
||||||
|
state_code,23
|
||||||
|
CityName1,Ludhiana
|
||||||
|
ContactPersonName,Kawalpreet Singh —
|
||||||
|
İkili dosya gösterilmiyor.
@@ -0,0 +1,75 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
.button {
|
||||||
|
background-color: #000000; /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div style="background-image: url('https://lh3.googleusercontent.com/p/AF1QipONWF8G50u9Bu-dklcj3kzesofOn8Z0q0LdHeU1=w1080-h608-p-no-v0');
|
||||||
|
/* Full height */
|
||||||
|
height: 100%;
|
||||||
|
/ Center and scale the image nicely /
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;">
|
||||||
|
|
||||||
|
<h1 class="button button5"> Visiting Card PARSER </h1>
|
||||||
|
<br> <br>
|
||||||
|
<a class="button button5"href="/">HOME</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form action="/submit" method="POST" enctype="multipart/form-data">
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="custom-file">
|
||||||
|
<input type="file" class="button button5" name="image" id="image"> <br> <br><br>
|
||||||
|
<div class="bg"></div>
|
||||||
|
<input class="button button5" type="submit">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height:100%;
|
||||||
|
font-family: 'Helvetica';
|
||||||
|
background-color:#000000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align:center;
|
||||||
|
letter-spacing:1.4px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Document</title>
|
||||||
|
<style>
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200;0,400;0,500;1,200;1,400;1,500;1,600&display=swap');
|
||||||
|
*,*::after,*::before{
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
body{
|
||||||
|
overflow-x: hidden;
|
||||||
|
font-family: 'Source Code Pro', monospace;
|
||||||
|
}
|
||||||
|
.container_scan{
|
||||||
|
background-color: #7ee8fa;
|
||||||
|
background-image: linear-gradient(315deg, #7ee8fa 0%, #80ff72 74%);
|
||||||
|
width: 100vw;
|
||||||
|
min-height: 100vh;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
overflow: hidden;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.headingCard{
|
||||||
|
padding: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card{
|
||||||
|
background-color: #fff;
|
||||||
|
width: 400px;
|
||||||
|
height: 500px;
|
||||||
|
border-radius: 25px;
|
||||||
|
border: 5px dashed #B8F1B0 ;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file {
|
||||||
|
opacity: 0;
|
||||||
|
width: 0.1px;
|
||||||
|
height: 0.1px;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-input label {
|
||||||
|
display: block;
|
||||||
|
position: relative;
|
||||||
|
width: 200px;
|
||||||
|
height: 50px;
|
||||||
|
border-radius: 25px;
|
||||||
|
background: linear-gradient(40deg, #ff6ec4, #7873f5);
|
||||||
|
box-shadow: 0 4px 7px rgba(0, 0, 0, 0.4);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: bold;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: transform .2s ease-out;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn{
|
||||||
|
padding: 10px 50px;
|
||||||
|
border-radius: 25px;
|
||||||
|
width: 250px;
|
||||||
|
height: 50px;
|
||||||
|
|
||||||
|
border: none;
|
||||||
|
background: linear-gradient(40deg, #f56effa6, #7873f5);
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
box-shadow: 0 4px 7px rgba(0, 0, 0, 0.4);
|
||||||
|
|
||||||
|
transition: all .2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn:hover{
|
||||||
|
transform: translateY(5px);
|
||||||
|
background: linear-gradient(40deg, #f56eff63, #73a3f5);
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
font-size: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formSubmit{
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background: linear-gradient(40deg, #f56effa6, #7873f5); /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;border-radius: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="container_scan">
|
||||||
|
<h1 class="headingCard">Visiting Card Parser</h1>
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form class="formSubmit" action="/submit" method="POST" enctype="multipart/form-data">
|
||||||
|
<div class="form-group">
|
||||||
|
<div class="custom-file">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="file-input">
|
||||||
|
<input type="file" id="image" name="image" class="button button2">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="submit" class="btn btn-submit">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
KY
|
||||||
|
—
|
||||||
|
LP
|
||||||
|
A,
|
||||||
|
—
|
||||||
|
~~
|
||||||
|
x
|
||||||
|
IWS
|
||||||
|
L.K. Agarwal
|
||||||
|
91 - 98480 92514
|
||||||
|
-
|
||||||
|
+
|
||||||
|
Ca rgo
|
||||||
|
(er 40 - 27813957
|
||||||
|
Lifters of India | — |+91 40 - 27810394
|
||||||
|
A
|
||||||
|
a
|
||||||
|
G4 cargo_lifters@rediffmail.com
|
||||||
|
ff
|
||||||
|
aH
|
||||||
|
j
|
||||||
|
4
|
||||||
|
4
|
||||||
|
Se
|
||||||
|
G-20, Minerva Complex, S.D. Road, Secunderabad - 500003.
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
KY
|
||||||
|
|
||||||
|
—
|
||||||
|
LP
|
||||||
|
A,
|
||||||
|
|
||||||
|
—
|
||||||
|
~~
|
||||||
|
x
|
||||||
|
IWS
|
||||||
|
|
||||||
|
L.K. Agarwal
|
||||||
|
|
||||||
|
91 - 98480 92514
|
||||||
|
|
||||||
|
-
|
||||||
|
|
||||||
|
+
|
||||||
|
|
||||||
|
Ca rgo
|
||||||
|
|
||||||
|
(er 40 - 27813957
|
||||||
|
Lifters of India | — |+91 40 - 27810394
|
||||||
|
|
||||||
|
A
|
||||||
|
|
||||||
|
a
|
||||||
|
|
||||||
|
G4 cargo_lifters@rediffmail.com
|
||||||
|
|
||||||
|
ff
|
||||||
|
|
||||||
|
aH
|
||||||
|
|
||||||
|
j
|
||||||
|
4
|
||||||
|
|
||||||
|
4
|
||||||
|
|
||||||
|
Se
|
||||||
|
|
||||||
|
G-20, Minerva Complex, S.D. Road, Secunderabad - 500003.
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
Keys,Values
|
||||||
|
PhoneNumber,91-9848092514
|
||||||
|
Email,cargo_lifters@rediffmail.com
|
||||||
|
ContactPersonName,L.K. Agarwal
|
||||||
|
PinCode1,500003
|
||||||
|
country_code,IN
|
||||||
|
LandMark1,"Secunderabad H.O, Kingsway"
|
||||||
|
state_name,Telangana
|
||||||
|
state_code,40
|
||||||
|
CityName1,Hyderabad
|
||||||
|
@@ -0,0 +1,491 @@
|
|||||||
|
import pickle
|
||||||
|
import numpy as np
|
||||||
|
import face_recognition
|
||||||
|
import os
|
||||||
|
import cv2
|
||||||
|
import datetime
|
||||||
|
import click
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
|
||||||
|
|
||||||
|
def predict123(eventid):
|
||||||
|
|
||||||
|
original_working_directory = os.getcwd()
|
||||||
|
new_networked_directory = r'\\192.168.88.99\\Bizgaze\\port6003\\wwwroot\\_files\\'
|
||||||
|
# change to the networked directory
|
||||||
|
os.chdir(new_networked_directory)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
People = "./ALL_UNQ/" + eventid + "/"
|
||||||
|
Gallery = './guestimage/'+ eventid + "/"
|
||||||
|
|
||||||
|
|
||||||
|
x= datetime.datetime.now()
|
||||||
|
print('Execution Started at:',x)
|
||||||
|
|
||||||
|
def saveEncodings(encs, names, fname='encodings.pickle'):
|
||||||
|
"""
|
||||||
|
Save encodings in a pickle file to be used in future.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
encs : List of np arrays
|
||||||
|
List of face encodings.
|
||||||
|
names : List of strings
|
||||||
|
List of names for each face encoding.
|
||||||
|
fname : String, optional
|
||||||
|
Name/Location for pickle file. The default is "encodings.pickle".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = []
|
||||||
|
d = [{"name": nm, "encoding": enc} for (nm, enc) in zip(names, encs)]
|
||||||
|
data.extend(d)
|
||||||
|
|
||||||
|
encodingsFile = fname
|
||||||
|
|
||||||
|
# dump the facial encodings data to disk
|
||||||
|
print("[INFO] serializing encodings...")
|
||||||
|
f = open(encodingsFile, "wb")
|
||||||
|
f.write(pickle.dumps(data))
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
# Function to read encodings
|
||||||
|
|
||||||
|
def readEncodingsPickle(fname):
|
||||||
|
"""
|
||||||
|
Read Pickle file.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
fname : String
|
||||||
|
Name of pickle file.(Full location)
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
encodings : list of np arrays
|
||||||
|
list of all saved encodings
|
||||||
|
names : List of Strings
|
||||||
|
List of all saved names
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = pickle.loads(open(fname, "rb").read())
|
||||||
|
data = np.array(data)
|
||||||
|
encodings = [d["encoding"] for d in data]
|
||||||
|
names = [d["name"] for d in data]
|
||||||
|
return encodings, names
|
||||||
|
|
||||||
|
# Function to create encodings and get face locations
|
||||||
|
def createEncodings(image):
|
||||||
|
print("Encoding")
|
||||||
|
"""
|
||||||
|
Create face encodings for a given image and also return face locations in the given image.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to detect faces from.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
known_encodings : list of np array
|
||||||
|
List of face encodings in a given image
|
||||||
|
face_locations : list of tuples
|
||||||
|
list of tuples for face locations in a given image
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Find face locations for all faces in an image
|
||||||
|
face_locations = face_recognition.face_locations(image)
|
||||||
|
|
||||||
|
# Create encodings for all faces in an image
|
||||||
|
known_encodings = face_recognition.face_encodings(image, known_face_locations=face_locations)
|
||||||
|
return known_encodings, face_locations
|
||||||
|
|
||||||
|
# Function to compare encodings
|
||||||
|
def compareFaceEncodings(unknown_encoding, known_encodings, known_names):
|
||||||
|
"""
|
||||||
|
Compares face encodings to check if 2 faces are same or not.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
unknown_encoding : np array
|
||||||
|
Face encoding of unknown people.
|
||||||
|
known_encodings : np array
|
||||||
|
Face encodings of known people.
|
||||||
|
known_names : list of strings
|
||||||
|
Names of known people
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
acceptBool : Bool
|
||||||
|
face matched or not
|
||||||
|
duplicateName : String
|
||||||
|
Name of matched face
|
||||||
|
distance : Float
|
||||||
|
Distance between 2 faces
|
||||||
|
|
||||||
|
"""
|
||||||
|
duplicateName = ""
|
||||||
|
distance = 0.0
|
||||||
|
matches = face_recognition.compare_faces(known_encodings, unknown_encoding, tolerance=0.47)
|
||||||
|
|
||||||
|
face_distances = face_recognition.face_distance(known_encodings, unknown_encoding)
|
||||||
|
|
||||||
|
best_match_index = np.argmin(face_distances)
|
||||||
|
|
||||||
|
distance = face_distances[best_match_index]
|
||||||
|
if matches[best_match_index]:
|
||||||
|
acceptBool = True
|
||||||
|
duplicateName = known_names[best_match_index]
|
||||||
|
else:
|
||||||
|
acceptBool = False
|
||||||
|
duplicateName = ""
|
||||||
|
return acceptBool, duplicateName, distance
|
||||||
|
|
||||||
|
p = []
|
||||||
|
def f_CSVwrite():
|
||||||
|
import pandas as pd
|
||||||
|
q = pd.DataFrame(p)
|
||||||
|
#print(q)
|
||||||
|
m = q
|
||||||
|
# print(m)
|
||||||
|
# x.drop(x.columns[Unnam], axis=1, inplace=True)
|
||||||
|
df = m.groupby([0], as_index=False).count()
|
||||||
|
z = df[0].str.split('/', expand=True)
|
||||||
|
|
||||||
|
|
||||||
|
z.to_csv('all_people.csv',index=False)
|
||||||
|
import pandas as pd
|
||||||
|
df2 = pd.read_csv('./all_people.csv')
|
||||||
|
df2.rename({df2.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
df2.rename({df2.columns[-2]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
df2 = df2[['Matched', 'test']]
|
||||||
|
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
import os
|
||||||
|
c = []
|
||||||
|
for root, dirs, files in os.walk(Gallery,
|
||||||
|
topdown=False):
|
||||||
|
for name in files:
|
||||||
|
# print(name)
|
||||||
|
L = os.path.join(root, name)
|
||||||
|
c.append(L)
|
||||||
|
df = pd.DataFrame(c)
|
||||||
|
|
||||||
|
df1 = df[0].str.split("/", expand=True)
|
||||||
|
#df1.rename({df1.columns[-2]: 'abc'}, axis=1, inplace=True)
|
||||||
|
# print('this is df1')
|
||||||
|
# print(df1)
|
||||||
|
df1.rename({df1.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
merge = pd.merge(df2, df1, on='test', how='left')
|
||||||
|
merge.rename({merge.columns[-1]: 'EventName'}, axis=1, inplace=True)
|
||||||
|
# merge.to_csv('merge.csv')
|
||||||
|
mergesplit = merge.loc[:, 'test'].str.split(".", expand=True)
|
||||||
|
mergesplit.rename({mergesplit.columns[-2]: 'ImageName'}, axis=1, inplace=True)
|
||||||
|
mergesplit = mergesplit.loc[:, 'ImageName']
|
||||||
|
|
||||||
|
#merge.rename({merge.columns[-1]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
#merge['EventName'] = merge['abc']
|
||||||
|
merge['Imagepath'] = "\\_files\\1\\Gallery\\" + merge['EventName'] + '\\' + + merge['test']
|
||||||
|
|
||||||
|
|
||||||
|
frames = [merge, mergesplit]
|
||||||
|
|
||||||
|
r = pd.concat(frames, axis=1, join='inner')
|
||||||
|
|
||||||
|
|
||||||
|
df2 = r.dropna(subset=['Matched'])
|
||||||
|
|
||||||
|
|
||||||
|
#df2['Matched'] = df2['Matched'].astype(str)
|
||||||
|
#df2['Matched'] = df2['Matched'].astype(int)
|
||||||
|
column_list = ['Matched', 'Imagepath', 'ImageName', 'EventName']
|
||||||
|
df2[column_list].to_csv('all_people_fina123.csv', index=False)
|
||||||
|
df2[column_list].to_json('all_people_final123.json', orient="records")
|
||||||
|
|
||||||
|
|
||||||
|
# import requests
|
||||||
|
# import json
|
||||||
|
|
||||||
|
# with open('all_people_final123.json', 'r') as json_file:
|
||||||
|
# json_load = json.load(json_file)
|
||||||
|
# #url = "https://test.bizgaze.app:8443/apis/v4/bizgaze/integrations/testevents/save"
|
||||||
|
|
||||||
|
# payload = json.dumps(json_load).replace("]", "").replace("[", "")
|
||||||
|
# print(payload)
|
||||||
|
# headers = {
|
||||||
|
# 'Authorization': 'stat 7f1007799b1f42999544d0338251bb19',
|
||||||
|
# 'Content-Type': 'application/json'
|
||||||
|
# }
|
||||||
|
# response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
|
# print("##############################################################")
|
||||||
|
# print(response.text)
|
||||||
|
|
||||||
|
# p.clear()
|
||||||
|
|
||||||
|
# Save Image to new directory
|
||||||
|
def saveImageToDirectory(image, name, imageName):
|
||||||
|
"""
|
||||||
|
Saves images to directory.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to save.
|
||||||
|
name : String
|
||||||
|
Directory where you want the image to be saved.
|
||||||
|
imageName : String
|
||||||
|
Name of image.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
# from pathlib import Path
|
||||||
|
# a=
|
||||||
|
# Path('Allunq_People/' + eventid).mkdir(exist_ok=True)
|
||||||
|
path = original_working_directory+"Allunq_People/" +eventid+'/'+ name
|
||||||
|
path1 = original_working_directory+"Allunq_People/" +eventid+'/'+name
|
||||||
|
if os.path.exists(path):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if not os.path.exists(path):
|
||||||
|
os.makedirs(path)
|
||||||
|
# os.mkdir(path,exist_ok=True)
|
||||||
|
cv2.imwrite(path + "/" + imageName, image)
|
||||||
|
x = []
|
||||||
|
c = (path1 + "/" + imageName)
|
||||||
|
x.append(c)
|
||||||
|
p.append(x)
|
||||||
|
f_CSVwrite()
|
||||||
|
|
||||||
|
# Function for creating encodings for known people
|
||||||
|
def processKnownPeopleImages(path=People, saveLocation="./Zero_gallery_known_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process images of known people and create face encodings to compare in future.
|
||||||
|
Eaach image should have just 1 face in it.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "C:/inetpub/vhosts/port82/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
known_encodings = []
|
||||||
|
known_names = []
|
||||||
|
for img in os.listdir(path):
|
||||||
|
imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(imgPath)
|
||||||
|
name = img.rsplit('.')[0]
|
||||||
|
# Resize
|
||||||
|
print(imgPath)
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
file = pathlib.Path(str(path+"Thumbs.db"))
|
||||||
|
if file.exists ():
|
||||||
|
os.remove(path+"Thumbs.db")
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
try:
|
||||||
|
known_encodings.append(encs[0])
|
||||||
|
except IndexError:
|
||||||
|
os.remove(People+img)
|
||||||
|
#known_encodings.append(encs[568])
|
||||||
|
known_names.append(name)
|
||||||
|
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
#cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
#cv2.destroyAllWindows()
|
||||||
|
saveEncodings(known_encodings, known_names, saveLocation)
|
||||||
|
|
||||||
|
# Function for processing dataset images
|
||||||
|
def processDatasetImages(saveLocation="./Gallery_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process image in dataset from where you want to separate images.
|
||||||
|
It separates the images into directories of known people, groups and any unknown people images.
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "D:/port1004/port1004/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Read pickle file for known people to compare faces from
|
||||||
|
people_encodings, names = readEncodingsPickle("./Zero_gallery_known_encodings.pickle")
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(Gallery, topdown=False):
|
||||||
|
|
||||||
|
for name in files:
|
||||||
|
s = os.path.join(root, name)
|
||||||
|
#print(p)
|
||||||
|
# imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(s)
|
||||||
|
orig = image.copy()
|
||||||
|
# print(imgPath)
|
||||||
|
# import pathlib
|
||||||
|
|
||||||
|
# file = pathlib.Path(str(path+"Thumbs.db"))
|
||||||
|
# if file.exists ():
|
||||||
|
# os.remove(path+"Thumbs.db")
|
||||||
|
# else:
|
||||||
|
# pass
|
||||||
|
# Resize
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
|
||||||
|
# Save image to a group image folder if more than one face is in image
|
||||||
|
# if len(locs) > 1:
|
||||||
|
# saveImageToDirectory(orig, "Group", img)
|
||||||
|
|
||||||
|
# Processing image for each face
|
||||||
|
i = 0
|
||||||
|
knownFlag = 0
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
unknown_encoding = encs[i]
|
||||||
|
i += 1
|
||||||
|
acceptBool, duplicateName, distance = compareFaceEncodings(unknown_encoding, people_encodings, names)
|
||||||
|
if acceptBool:
|
||||||
|
saveImageToDirectory(orig, duplicateName,name)
|
||||||
|
knownFlag = 1
|
||||||
|
if knownFlag == 1:
|
||||||
|
print("Match Found")
|
||||||
|
|
||||||
|
else:
|
||||||
|
saveImageToDirectory(orig, "0",name)
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
# cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# # cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
# cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""
|
||||||
|
Main Function.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
processKnownPeopleImages()
|
||||||
|
processDatasetImages()
|
||||||
|
# import pandas as pd
|
||||||
|
# q = pd.DataFrame(p)
|
||||||
|
# #print(q)
|
||||||
|
# m = q
|
||||||
|
# # print(m)
|
||||||
|
# # x.drop(x.columns[Unnam], axis=1, inplace=True)
|
||||||
|
# df = m.groupby([0], as_index=False).count()
|
||||||
|
# z = df[0].str.split('/', expand=True)
|
||||||
|
|
||||||
|
|
||||||
|
# z.to_csv('all_people.csv',index=False)
|
||||||
|
# import pandas as pd
|
||||||
|
# df2 = pd.read_csv('./all_people.csv')
|
||||||
|
# df2.rename({df2.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
# df2.rename({df2.columns[-2]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
# df2 = df2[['Matched', 'test']]
|
||||||
|
|
||||||
|
|
||||||
|
# import pandas as pd
|
||||||
|
# import os
|
||||||
|
# c = []
|
||||||
|
# for root, dirs, files in os.walk(Gallery,
|
||||||
|
# topdown=False):
|
||||||
|
# for name in files:
|
||||||
|
# # print(name)
|
||||||
|
# L = os.path.join(root, name)
|
||||||
|
# c.append(L)
|
||||||
|
# df = pd.DataFrame(c)
|
||||||
|
|
||||||
|
# df1 = df[0].str.split("/", expand=True)
|
||||||
|
# #df1.rename({df1.columns[-2]: 'abc'}, axis=1, inplace=True)
|
||||||
|
# # print('this is df1')
|
||||||
|
# # print(df1)
|
||||||
|
# df1.rename({df1.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
# merge = pd.merge(df2, df1, on='test', how='left')
|
||||||
|
# merge.rename({merge.columns[-1]: 'EventName'}, axis=1, inplace=True)
|
||||||
|
# # merge.to_csv('merge.csv')
|
||||||
|
# mergesplit = merge.loc[:, 'test'].str.split(".", expand=True)
|
||||||
|
# mergesplit.rename({mergesplit.columns[-2]: 'ImageName'}, axis=1, inplace=True)
|
||||||
|
# mergesplit = mergesplit.loc[:, 'ImageName']
|
||||||
|
|
||||||
|
# #merge.rename({merge.columns[-1]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
# #merge['EventName'] = merge['abc']
|
||||||
|
# merge['Imagepath'] = "\\_files\\1\\Gallery\\" + merge['EventName'] + '\\' + + merge['test']
|
||||||
|
|
||||||
|
|
||||||
|
# frames = [merge, mergesplit]
|
||||||
|
|
||||||
|
# r = pd.concat(frames, axis=1, join='inner')
|
||||||
|
|
||||||
|
|
||||||
|
# df2 = r.dropna(subset=['Matched'])
|
||||||
|
|
||||||
|
|
||||||
|
# #df2['Matched'] = df2['Matched'].astype(str)
|
||||||
|
# #df2['Matched'] = df2['Matched'].astype(int)
|
||||||
|
# column_list = ['Matched', 'Imagepath', 'ImageName', 'EventName']
|
||||||
|
# df2[column_list].to_csv('all_people_fina123.csv', index=False)
|
||||||
|
# df2[column_list].to_json('all_people_final123.json', orient="records")
|
||||||
|
|
||||||
|
# print("Completed")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
# return render_template('index.html')
|
||||||
|
y=datetime.datetime.now()
|
||||||
|
print('Completed at:',y)
|
||||||
|
z=y-x
|
||||||
|
print('Time Taken:',z)
|
||||||
|
return (str(y-x))
|
||||||
|
#return 'ALL IMAGES MATCHED'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
predict123()
|
||||||
@@ -0,0 +1,527 @@
|
|||||||
|
import pickle
|
||||||
|
import numpy as np
|
||||||
|
import face_recognition
|
||||||
|
import os
|
||||||
|
import cv2
|
||||||
|
import datetime
|
||||||
|
import click
|
||||||
|
import requests
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
|
||||||
|
|
||||||
|
def predict456(eventid):
|
||||||
|
|
||||||
|
original_working_directory = os.getcwd()
|
||||||
|
new_networked_directory = r'\\192.168.88.99\\Bizgaze\\port6003\\wwwroot\\_files\\'
|
||||||
|
# change to the networked directory
|
||||||
|
os.chdir(new_networked_directory)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#People = './ALL_UNQ/' + eventid + "/"
|
||||||
|
People="./ALL_UNQ/"+ eventid + "/"
|
||||||
|
#Gallery = './Copy_Gallery/'+ eventid + "/"
|
||||||
|
Gallery='./1/CopyGallery/'+ eventid + "/"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
x= datetime.datetime.now()
|
||||||
|
print('ALLunq_copy_gallery Running')
|
||||||
|
print('Execution Started at:',x)
|
||||||
|
|
||||||
|
def saveEncodings(encs, names, fname='encodings.pickle'):
|
||||||
|
"""
|
||||||
|
Save encodings in a pickle file to be used in future.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
encs : List of np arrays
|
||||||
|
List of face encodings.
|
||||||
|
names : List of strings
|
||||||
|
List of names for each face encoding.
|
||||||
|
fname : String, optional
|
||||||
|
Name/Location for pickle file. The default is "encodings.pickle".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = []
|
||||||
|
d = [{"name": nm, "encoding": enc} for (nm, enc) in zip(names, encs)]
|
||||||
|
data.extend(d)
|
||||||
|
|
||||||
|
encodingsFile = fname
|
||||||
|
|
||||||
|
# dump the facial encodings data to disk
|
||||||
|
print("[INFO] serializing encodings...")
|
||||||
|
f = open(encodingsFile, "wb")
|
||||||
|
f.write(pickle.dumps(data))
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
# Function to read encodings
|
||||||
|
|
||||||
|
def readEncodingsPickle(fname):
|
||||||
|
"""
|
||||||
|
Read Pickle file.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
fname : String
|
||||||
|
Name of pickle file.(Full location)
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
encodings : list of np arrays
|
||||||
|
list of all saved encodings
|
||||||
|
names : List of Strings
|
||||||
|
List of all saved names
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = pickle.loads(open(fname, "rb").read())
|
||||||
|
data = np.array(data)
|
||||||
|
encodings = [d["encoding"] for d in data]
|
||||||
|
names = [d["name"] for d in data]
|
||||||
|
return encodings, names
|
||||||
|
|
||||||
|
# Function to create encodings and get face locations
|
||||||
|
def createEncodings(image):
|
||||||
|
print("Encoding")
|
||||||
|
"""
|
||||||
|
Create face encodings for a given image and also return face locations in the given image.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to detect faces from.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
known_encodings : list of np array
|
||||||
|
List of face encodings in a given image
|
||||||
|
face_locations : list of tuples
|
||||||
|
list of tuples for face locations in a given image
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Find face locations for all faces in an image
|
||||||
|
face_locations = face_recognition.face_locations(image)
|
||||||
|
|
||||||
|
# Create encodings for all faces in an image
|
||||||
|
known_encodings = face_recognition.face_encodings(image, known_face_locations=face_locations)
|
||||||
|
return known_encodings, face_locations
|
||||||
|
|
||||||
|
# Function to compare encodings
|
||||||
|
def compareFaceEncodings(unknown_encoding, known_encodings, known_names):
|
||||||
|
"""
|
||||||
|
Compares face encodings to check if 2 faces are same or not.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
unknown_encoding : np array
|
||||||
|
Face encoding of unknown people.
|
||||||
|
known_encodings : np array
|
||||||
|
Face encodings of known people.
|
||||||
|
known_names : list of strings
|
||||||
|
Names of known people
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
acceptBool : Bool
|
||||||
|
face matched or not
|
||||||
|
duplicateName : String
|
||||||
|
Name of matched face
|
||||||
|
distance : Float
|
||||||
|
Distance between 2 faces
|
||||||
|
|
||||||
|
"""
|
||||||
|
duplicateName = ""
|
||||||
|
distance = 0.0
|
||||||
|
matches = face_recognition.compare_faces(known_encodings, unknown_encoding, tolerance=0.47)
|
||||||
|
|
||||||
|
face_distances = face_recognition.face_distance(known_encodings, unknown_encoding)
|
||||||
|
|
||||||
|
best_match_index = np.argmin(face_distances)
|
||||||
|
|
||||||
|
distance = face_distances[best_match_index]
|
||||||
|
if matches[best_match_index]:
|
||||||
|
acceptBool = True
|
||||||
|
duplicateName = known_names[best_match_index]
|
||||||
|
else:
|
||||||
|
acceptBool = False
|
||||||
|
duplicateName = ""
|
||||||
|
return acceptBool, duplicateName, distance
|
||||||
|
|
||||||
|
p = []
|
||||||
|
|
||||||
|
def f_CSVwrite():
|
||||||
|
import pandas as pd
|
||||||
|
q = pd.DataFrame(p)
|
||||||
|
#print(q)
|
||||||
|
m = q
|
||||||
|
# print(m)
|
||||||
|
# x.drop(x.columns[Unnam], axis=1, inplace=True)
|
||||||
|
df = m.groupby([0], as_index=False).count()
|
||||||
|
z = df[0].str.split('/', expand=True)
|
||||||
|
|
||||||
|
|
||||||
|
z.to_csv('zzzzzzzzzzzzz.csv',index=False)
|
||||||
|
import pandas as pd
|
||||||
|
df2 = pd.read_csv('./zzzzzzzzzzzzz.csv')
|
||||||
|
df2.rename({df2.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
df2.rename({df2.columns[-2]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
df2 = df2[['Matched', 'test']]
|
||||||
|
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
import os
|
||||||
|
c = []
|
||||||
|
for root, dirs, files in os.walk(Gallery,
|
||||||
|
topdown=False):
|
||||||
|
for name in files:
|
||||||
|
# print(name)
|
||||||
|
L = os.path.join(root, name)
|
||||||
|
c.append(L)
|
||||||
|
df = pd.DataFrame(c)
|
||||||
|
|
||||||
|
df1 = df[0].str.split("/", expand=True)
|
||||||
|
#df1.rename({df1.columns[-2]: 'abc'}, axis=1, inplace=True)
|
||||||
|
# print('this is df1')
|
||||||
|
# print(df1)
|
||||||
|
df1.rename({df1.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
merge = pd.merge(df2, df1, on='test', how='left')
|
||||||
|
merge.rename({merge.columns[-1]: 'EventName'}, axis=1, inplace=True)
|
||||||
|
# merge.to_csv('merge.csv')
|
||||||
|
mergesplit = merge.loc[:, 'test'].str.split(".", expand=True)
|
||||||
|
mergesplit.rename({mergesplit.columns[-2]: 'ImageName1'}, axis=1, inplace=True)
|
||||||
|
mergesplit = mergesplit.loc[:, 'ImageName1']
|
||||||
|
|
||||||
|
#merge.rename({merge.columns[-1]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
#merge['EventName'] = merge['abc']
|
||||||
|
merge['Imagepath'] = "\\_files\\1\\Gallery\\" + merge['EventName'] + '\\' + + merge['test']
|
||||||
|
merge['Matched']='\\_files\\ALL_UNQ\\'+eventid+'\\'+df2['Matched']+'.jpg'
|
||||||
|
merge["ImageName"]=df2['Matched']+'.jpg'
|
||||||
|
|
||||||
|
frames = [merge, mergesplit]
|
||||||
|
|
||||||
|
r = pd.concat(frames, axis=1, join='inner')
|
||||||
|
|
||||||
|
|
||||||
|
df2 = r.dropna(subset=['Matched'])
|
||||||
|
|
||||||
|
|
||||||
|
#df2['Matched'] = df2['Matched'].astype(str)
|
||||||
|
#df2['Matched'] = df2['Matched'].astype(int)
|
||||||
|
column_list = ['Matched', 'ImageName','Imagepath', 'ImageName1', 'EventName']
|
||||||
|
df2[column_list].to_csv('Zero_Gallery123254.csv', index=False)
|
||||||
|
df2[column_list].to_json('events12554.json', orient="records")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# import json
|
||||||
|
#
|
||||||
|
# with open('events.json', 'r') as json_file:
|
||||||
|
# json_load = json.load(json_file)
|
||||||
|
#
|
||||||
|
# print(json_load)
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
|
||||||
|
with open('events12554.json', 'r') as json_file:
|
||||||
|
json_load = json.load(json_file)
|
||||||
|
url = "https://eventxstreamnew.bizgaze.com:5443/apis/v4/bizgaze/integrations/testevents/unregistereduser"
|
||||||
|
|
||||||
|
payload = json.dumps(json_load).replace("]", "").replace("[", "")
|
||||||
|
print(payload)
|
||||||
|
headers = {
|
||||||
|
'Authorization': 'stat e44ced3eff684aa9b932672ea8406029',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
|
print("##############################################################")
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
p.clear()
|
||||||
|
|
||||||
|
|
||||||
|
# Save Image to new directory
|
||||||
|
def saveImageToDirectory(image, name, imageName):
|
||||||
|
"""
|
||||||
|
Saves images to directory.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to save.
|
||||||
|
name : String
|
||||||
|
Directory where you want the image to be saved.
|
||||||
|
imageName : String
|
||||||
|
Name of image.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
path = original_working_directory+"/Allunq_CopyGallery/" + name
|
||||||
|
path1 = original_working_directory+"/Allunq_CopyGallery/" + name
|
||||||
|
if os.path.exists(path):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if not os.path.exists(path):
|
||||||
|
os.makedirs(path)
|
||||||
|
# os.mkdir(path,exist_ok=True)
|
||||||
|
cv2.imwrite(path + "/" + imageName, image)
|
||||||
|
x = []
|
||||||
|
c = (path1 + "/" + imageName)
|
||||||
|
x.append(c)
|
||||||
|
p.append(x)
|
||||||
|
f_CSVwrite()
|
||||||
|
|
||||||
|
# Function for creating encodings for known people
|
||||||
|
def processKnownPeopleImages(path=People, saveLocation="./Zero_gallery_known_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process images of known people and create face encodings to compare in future.
|
||||||
|
Eaach image should have just 1 face in it.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "C:/inetpub/vhosts/port82/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
known_encodings = []
|
||||||
|
known_names = []
|
||||||
|
for img in os.listdir(path):
|
||||||
|
imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(imgPath)
|
||||||
|
name = img.rsplit('.')[0]
|
||||||
|
# Resize
|
||||||
|
print(imgPath)
|
||||||
|
import pathlib
|
||||||
|
|
||||||
|
file = pathlib.Path(str(path+"Thumbs.db"))
|
||||||
|
if file.exists ():
|
||||||
|
os.remove(path+"Thumbs.db")
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
try:
|
||||||
|
known_encodings.append(encs[0])
|
||||||
|
except IndexError:
|
||||||
|
os.remove(People+img)
|
||||||
|
#known_encodings.append(encs[568])
|
||||||
|
known_names.append(name)
|
||||||
|
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
#cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
#cv2.destroyAllWindows()
|
||||||
|
saveEncodings(known_encodings, known_names, saveLocation)
|
||||||
|
|
||||||
|
# Function for processing dataset images
|
||||||
|
def processDatasetImages(saveLocation="./Gallery_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process image in dataset from where you want to separate images.
|
||||||
|
It separates the images into directories of known people, groups and any unknown people images.
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "D:/port1004/port1004/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Read pickle file for known people to compare faces from
|
||||||
|
people_encodings, names = readEncodingsPickle("./Zero_gallery_known_encodings.pickle")
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(Gallery, topdown=False):
|
||||||
|
|
||||||
|
for name in files:
|
||||||
|
s = os.path.join(root, name)
|
||||||
|
#print(p)
|
||||||
|
# imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(s)
|
||||||
|
orig = image.copy()
|
||||||
|
|
||||||
|
# Resize
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
|
||||||
|
# Save image to a group image folder if more than one face is in image
|
||||||
|
# if len(locs) > 1:
|
||||||
|
# saveImageToDirectory(orig, "Group", img)
|
||||||
|
|
||||||
|
# Processing image for each face
|
||||||
|
i = 0
|
||||||
|
knownFlag = 0
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
unknown_encoding = encs[i]
|
||||||
|
i += 1
|
||||||
|
acceptBool, duplicateName, distance = compareFaceEncodings(unknown_encoding, people_encodings, names)
|
||||||
|
if acceptBool:
|
||||||
|
saveImageToDirectory(orig, duplicateName,name)
|
||||||
|
knownFlag = 1
|
||||||
|
if knownFlag == 1:
|
||||||
|
print("Match Found")
|
||||||
|
|
||||||
|
else:
|
||||||
|
saveImageToDirectory(orig, "0",name)
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
# cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# # cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
# cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""
|
||||||
|
Main Function.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
processKnownPeopleImages()
|
||||||
|
processDatasetImages()
|
||||||
|
# import pandas as pd
|
||||||
|
# q = pd.DataFrame(p)
|
||||||
|
# #print(q)
|
||||||
|
# m = q
|
||||||
|
# # print(m)
|
||||||
|
# # x.drop(x.columns[Unnam], axis=1, inplace=True)
|
||||||
|
# df = m.groupby([0], as_index=False).count()
|
||||||
|
# z = df[0].str.split('/', expand=True)
|
||||||
|
|
||||||
|
|
||||||
|
# z.to_csv('zzzzzzzzzzzzz.csv',index=False)
|
||||||
|
# import pandas as pd
|
||||||
|
# df2 = pd.read_csv('./zzzzzzzzzzzzz.csv')
|
||||||
|
# df2.rename({df2.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
# df2.rename({df2.columns[-2]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
# df2 = df2[['Matched', 'test']]
|
||||||
|
|
||||||
|
|
||||||
|
# import pandas as pd
|
||||||
|
# import os
|
||||||
|
# c = []
|
||||||
|
# for root, dirs, files in os.walk(Gallery,
|
||||||
|
# topdown=False):
|
||||||
|
# for name in files:
|
||||||
|
# # print(name)
|
||||||
|
# L = os.path.join(root, name)
|
||||||
|
# c.append(L)
|
||||||
|
# df = pd.DataFrame(c)
|
||||||
|
|
||||||
|
# df1 = df[0].str.split("/", expand=True)
|
||||||
|
# #df1.rename({df1.columns[-2]: 'abc'}, axis=1, inplace=True)
|
||||||
|
# # print('this is df1')
|
||||||
|
# # print(df1)
|
||||||
|
# df1.rename({df1.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
# merge = pd.merge(df2, df1, on='test', how='left')
|
||||||
|
# merge.rename({merge.columns[-1]: 'EventName'}, axis=1, inplace=True)
|
||||||
|
# # merge.to_csv('merge.csv')
|
||||||
|
# mergesplit = merge.loc[:, 'test'].str.split(".", expand=True)
|
||||||
|
# mergesplit.rename({mergesplit.columns[-2]: 'ImageName'}, axis=1, inplace=True)
|
||||||
|
# mergesplit = mergesplit.loc[:, 'ImageName']
|
||||||
|
|
||||||
|
# #merge.rename({merge.columns[-1]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
# #merge['EventName'] = merge['abc']
|
||||||
|
# merge['Imagepath'] = "\\_files\\1\\Gallery\\" + merge['EventName'] + '\\' + + merge['test']
|
||||||
|
# merge['Matched']='\\_files\\ALL_UNQ\\'+eventid+'\\'+df2['Matched']+'.jpg'
|
||||||
|
# merge["MatchedImageName"]=df2['Matched']
|
||||||
|
|
||||||
|
# frames = [merge, mergesplit]
|
||||||
|
|
||||||
|
# r = pd.concat(frames, axis=1, join='inner')
|
||||||
|
|
||||||
|
|
||||||
|
# df2 = r.dropna(subset=['Matched'])
|
||||||
|
|
||||||
|
|
||||||
|
# #df2['Matched'] = df2['Matched'].astype(str)
|
||||||
|
# #df2['Matched'] = df2['Matched'].astype(int)
|
||||||
|
# column_list = ['Matched','MatchedImageName','Imagepath', 'ImageName', 'EventName']
|
||||||
|
# df2[column_list].to_csv('Zero_Gallery123254.csv', index=False)
|
||||||
|
# df2[column_list].to_json('events12554.json', orient="records")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# import json
|
||||||
|
#
|
||||||
|
# with open('events.json', 'r') as json_file:
|
||||||
|
# json_load = json.load(json_file)
|
||||||
|
#
|
||||||
|
# print(json_load)
|
||||||
|
# import requests
|
||||||
|
# import json
|
||||||
|
|
||||||
|
# with open('events12554.json', 'r') as json_file:
|
||||||
|
# json_load = json.load(json_file)
|
||||||
|
# #url = "https://eventxstreamnew.bizgaze.com:5443/apis/v4/bizgaze/integrations/testevents/unregistereduser"
|
||||||
|
|
||||||
|
# payload = json.dumps(json_load).replace("]", "").replace("[", "")
|
||||||
|
# print(payload)
|
||||||
|
# headers = {
|
||||||
|
# 'Authorization': 'stat e44ced3eff684aa9b932672ea8406029',
|
||||||
|
# 'Content-Type': 'application/json'
|
||||||
|
# }
|
||||||
|
# response = requests.request("POST", url, headers=headers, data=payload)
|
||||||
|
# print("##############################################################")
|
||||||
|
# print(response.text)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print("Completed")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
# return render_template('index.html')
|
||||||
|
y=datetime.datetime.now()
|
||||||
|
print('Completed at:',y)
|
||||||
|
z=y-x
|
||||||
|
print('Time Taken:',z)
|
||||||
|
return (str(y-x))
|
||||||
|
#return 'ALL IMAGES MATCHED'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
predict456()
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[{"Matched":"\\_files\\ALL_UNQ\\100013660000161\\sefsf4556.jpg","ImageName":"sefsf4556.jpg","Imagepath":"\\_files\\1\\Gallery\\100013660000161\\100011460001404.jpg","ImageName1":"100011460001404","EventName":"100013660000161"}]
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
#from IPython.core.pylabtools import find_gui_and_backend
|
||||||
|
#from oswalk import files
|
||||||
|
#from google.colab.patches import cv2_imshow
|
||||||
|
import cv2
|
||||||
|
import mediapipe as mp
|
||||||
|
import numpy as np
|
||||||
|
import glob
|
||||||
|
import click
|
||||||
|
mp_face_mesh = mp.solutions.face_mesh
|
||||||
|
face_mesh = mp_face_mesh.FaceMesh(min_detection_confidence=0.5, min_tracking_confidence=0.5)
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
|
||||||
|
def cap(eventid):
|
||||||
|
|
||||||
|
for files in glob.glob("C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\sepration_crop\\"+eventid+"\\*"):
|
||||||
|
image = cv2.imread(files)
|
||||||
|
|
||||||
|
# Flip the image horizontally for a later selfie-view display
|
||||||
|
# Also convert the color space from BGR to RGB
|
||||||
|
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
|
||||||
|
|
||||||
|
# To improve performance
|
||||||
|
image.flags.writeable = False
|
||||||
|
|
||||||
|
# Get the result
|
||||||
|
results = face_mesh.process(image)
|
||||||
|
|
||||||
|
# To improve performance
|
||||||
|
image.flags.writeable = True
|
||||||
|
|
||||||
|
# Convert the color space from RGB to BGR
|
||||||
|
image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)
|
||||||
|
|
||||||
|
img_h, img_w, img_c = image.shape
|
||||||
|
face_3d = []
|
||||||
|
face_2d = []
|
||||||
|
|
||||||
|
if results.multi_face_landmarks:
|
||||||
|
for face_landmarks in results.multi_face_landmarks:
|
||||||
|
for idx, lm in enumerate(face_landmarks.landmark):
|
||||||
|
if idx == 33 or idx == 263 or idx == 1 or idx == 61 or idx == 291 or idx == 199:
|
||||||
|
if idx == 1:
|
||||||
|
nose_2d = (lm.x * img_w, lm.y * img_h)
|
||||||
|
nose_3d = (lm.x * img_w, lm.y * img_h, lm.z * 8000)
|
||||||
|
|
||||||
|
x, y = int(lm.x * img_w), int(lm.y * img_h)
|
||||||
|
|
||||||
|
# Get the 2D Coordinates
|
||||||
|
face_2d.append([x, y])
|
||||||
|
|
||||||
|
# Get the 3D Coordinates
|
||||||
|
face_3d.append([x, y, lm.z])
|
||||||
|
|
||||||
|
# Convert it to the NumPy array
|
||||||
|
face_2d = np.array(face_2d, dtype=np.float64)
|
||||||
|
|
||||||
|
# Convert it to the NumPy array
|
||||||
|
face_3d = np.array(face_3d, dtype=np.float64)
|
||||||
|
|
||||||
|
# The camera matrix
|
||||||
|
focal_length = 1 * img_w
|
||||||
|
|
||||||
|
cam_matrix = np.array([ [focal_length, 0, img_h / 2],
|
||||||
|
[0, focal_length, img_w / 2],
|
||||||
|
[0, 0, 1]])
|
||||||
|
|
||||||
|
# The Distance Matrix
|
||||||
|
dist_matrix = np.zeros((4, 1), dtype=np.float64)
|
||||||
|
|
||||||
|
# Solve PnP
|
||||||
|
success, rot_vec, trans_vec = cv2.solvePnP(face_3d, face_2d, cam_matrix, dist_matrix)
|
||||||
|
|
||||||
|
# Get rotational matrix
|
||||||
|
rmat, jac = cv2.Rodrigues(rot_vec)
|
||||||
|
|
||||||
|
# Get angles
|
||||||
|
angles, mtxR, mtxQ, Qx, Qy, Qz = cv2.RQDecomp3x3(rmat)
|
||||||
|
|
||||||
|
# Get the y rotation degree
|
||||||
|
x = angles[0] * 360
|
||||||
|
y = angles[1] * 360
|
||||||
|
|
||||||
|
# print(y)
|
||||||
|
|
||||||
|
# See where the user's head tilting
|
||||||
|
if y < -20:
|
||||||
|
text = "Left"
|
||||||
|
elif y > 20:
|
||||||
|
text = "Right"
|
||||||
|
elif x < -20:
|
||||||
|
text = "Down"
|
||||||
|
else:
|
||||||
|
text = "Forward"
|
||||||
|
#djtillu.append(files)
|
||||||
|
print(files)
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
shutil.copy2(files, 'C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\front_face\\'+eventid+"\\")
|
||||||
|
|
||||||
|
# Display the nose direction
|
||||||
|
nose_3d_projection, jacobian = cv2.projectPoints(nose_3d, rot_vec, trans_vec, cam_matrix, dist_matrix)
|
||||||
|
|
||||||
|
p1 = (int(nose_2d[0]), int(nose_2d[1]))
|
||||||
|
p2 = (int(nose_3d_projection[0][0][0]), int(nose_3d_projection[0][0][1]))
|
||||||
|
|
||||||
|
cv2.line(image, p1, p2, (255, 0, 0), 2)
|
||||||
|
|
||||||
|
# Add the text on the image
|
||||||
|
cv2.putText(image, text, (20, 20), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 2)
|
||||||
|
|
||||||
|
# cv2_imshow(image)
|
||||||
|
#
|
||||||
|
# if cv2.waitKey(5) & 0xFF == 27:
|
||||||
|
# pass
|
||||||
|
|
||||||
|
cap()
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import os
|
||||||
|
import click
|
||||||
|
import shutil
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def checkfolder(eventid):
|
||||||
|
|
||||||
|
original_working_directory = os.getcwd()
|
||||||
|
new_networked_directory = r'\\192.168.88.99\\Bizgaze\\port6003\\wwwroot\\_files\\'
|
||||||
|
# change to the networked directory
|
||||||
|
os.chdir(new_networked_directory)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for dirpath, dirnames, files in os.walk('.\\ALL_UNQ\\' + eventid + '/'):
|
||||||
|
if os.listdir(dirpath)==[]:
|
||||||
|
print("files not found")
|
||||||
|
for root, dirs, files in os.walk('C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\unique_1\\' + eventid + '\\'):
|
||||||
|
for file in files:
|
||||||
|
path_file = os.path.join(root, file)
|
||||||
|
shutil.move(path_file, '.\\ALL_UNQ\\' + eventid + "\\")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("files found")
|
||||||
|
cmd = "python C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\unique_Allunq.py "+ str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
checkfolder()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import requests
|
||||||
|
import json
|
||||||
|
with open('C:\\Users\\Bizgaze\\Desktop\\AI\\AI_Events\\csv\\EventXtream.json', 'r') as json_file:
|
||||||
|
json_load = json.load(json_file)
|
||||||
|
url = "http://localhost:3088/apis/v4/bizgaze/integrations/json/save/List"
|
||||||
|
|
||||||
|
payload1 = json.dumps(json_load)#.replace("]", "").replace("[", "")
|
||||||
|
print('--------------------------------------------------------------------------')
|
||||||
|
print(payload1)
|
||||||
|
headers = {
|
||||||
|
'Authorization': 'Stat 22cbfadfa548448bb0b55193bc8e99fa',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
response = requests.request("POST", url, headers=headers, data=payload1)
|
||||||
|
print("##############################################################")
|
||||||
|
print(response.text)
|
||||||
@@ -0,0 +1,252 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
import click
|
||||||
|
from flask import Flask, render_template, request, redirect, send_file
|
||||||
|
import shutil
|
||||||
|
import glob
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@app.route('/', methods=['GET'])
|
||||||
|
def home():
|
||||||
|
return render_template('index.html')
|
||||||
|
|
||||||
|
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
# def crop_Alluq():
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\sepration_crop.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\front_face.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\sepration_cluster.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\unique_1.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\unique_Allunq.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
#
|
||||||
|
# # import os
|
||||||
|
# # cmd = "python .\\Allunq_copy_gallery.py"
|
||||||
|
# # os.system(cmd)
|
||||||
|
#
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\remove.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# def sync_Alluq_people():
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\Allunq_People.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def crop_Alluq(eventid,original_working_directory):
|
||||||
|
|
||||||
|
|
||||||
|
print("started with images")
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\sepration_crop.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\front_face.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\sepration_cluster.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\unique_1.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
#eventid="789456123"
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\is_existALLUNQ.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\Allunq_copy_gallery.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\Allunq_People.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
return "ended with images"
|
||||||
|
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\remove.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def sync_Alluq_people(eventid,original_working_directory):
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
cmd = "python "+original_working_directory+"\\Allunq_People.py"+" "+str(eventid)
|
||||||
|
os.system(cmd)
|
||||||
|
|
||||||
|
return "ended with images"
|
||||||
|
|
||||||
|
|
||||||
|
def create_dir(eventid,original_working_directory):
|
||||||
|
|
||||||
|
# original_working_directory = os.getcwd()
|
||||||
|
# new_networked_directory = r'\\192.168.88.99\\Bizgaze\\port6003\\wwwroot\\_files\\'
|
||||||
|
# # change to the networked directory
|
||||||
|
# os.chdir(new_networked_directory)
|
||||||
|
print(original_working_directory)
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
Path(original_working_directory+'\\front_face\\' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/sepration_cluster/'+eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/sepration_crop/' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/unique_1/' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path('ALL_UNQ/' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/output_unique_ALLUNQ/' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/people_Allunq_zero_maingallery/' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/Allunq_People/' + eventid).mkdir(exist_ok=True)
|
||||||
|
Path(original_working_directory+'/Allunq_CopyGallery/' + eventid).mkdir(exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/eventwise', methods=["GET", "POST"])
|
||||||
|
|
||||||
|
def eventwise():
|
||||||
|
import os
|
||||||
|
original_working_directory = os.getcwd()
|
||||||
|
new_networked_directory = r'\\192.168.88.99\\Bizgaze\\port6003\\wwwroot\\_files'
|
||||||
|
# change to the networked directory
|
||||||
|
os.chdir(new_networked_directory)
|
||||||
|
|
||||||
|
eventid= request.args.get('Dataset')
|
||||||
|
# Id.append(Events)
|
||||||
|
|
||||||
|
|
||||||
|
create_dir(eventid,original_working_directory)
|
||||||
|
|
||||||
|
import pathlib
|
||||||
|
file = pathlib.Path(new_networked_directory+"/"+eventid+"/"+"Thumbs.db")
|
||||||
|
if file.exists ():
|
||||||
|
os.remove(new_networked_directory+"/"+eventid+"/"+'Thumbs.db')
|
||||||
|
else:
|
||||||
|
pass
|
||||||
|
|
||||||
|
x = datetime.datetime.now()
|
||||||
|
print('Execution Started at:', x)
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
# path of the directory
|
||||||
|
|
||||||
|
for dirpath, dirnames, files in os.walk('1/CopyGallery/' + eventid + '/'):
|
||||||
|
if os.listdir(dirpath)==[]:
|
||||||
|
#f = os.path.join(root, name)
|
||||||
|
# Checking the length of list
|
||||||
|
#if len((f)) == 0:
|
||||||
|
print("No files found in the directory.")
|
||||||
|
print("working on sync_Alluq_people.........")
|
||||||
|
sync_Alluq_people(eventid,original_working_directory)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Some files found in the directory.")
|
||||||
|
print("working on crop_Alluq.........")
|
||||||
|
crop_Alluq(eventid,original_working_directory)
|
||||||
|
|
||||||
|
|
||||||
|
return "ended with images"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\people_Allunq_zero_maingallery.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
|
||||||
|
# import os
|
||||||
|
# cmd = "python .\\remove.py"
|
||||||
|
# os.system(cmd)
|
||||||
|
# import requests
|
||||||
|
# import json
|
||||||
|
|
||||||
|
# with open('C:\\Users\\Bizgaze\\Desktop\\AI\\AI_Events\\csv\\EventXtream.json', 'r') as json_file:
|
||||||
|
# json_load = json.load(json_file)
|
||||||
|
# url = "http://localhost:3088/apis/v4/bizgaze/integrations/json/save"
|
||||||
|
|
||||||
|
# payload1 = json.dumps(json_load).replace("]", "").replace("[", "")
|
||||||
|
# print('--------------------------------------------------------------------------')
|
||||||
|
# print(payload1)
|
||||||
|
# headers = {
|
||||||
|
# 'Authorization': 'Stat a528db7c512f494eab8bfef012c220e0',
|
||||||
|
# 'Content-Type': 'application/json'
|
||||||
|
# }
|
||||||
|
# response = requests.request("POST", url, headers=headers, data=payload1)
|
||||||
|
# print("##############################################################")
|
||||||
|
# print(response.text)
|
||||||
|
|
||||||
|
|
||||||
|
# y = datetime.datetime.now()
|
||||||
|
# print('Completed at:', y)
|
||||||
|
# z = y - x
|
||||||
|
# print('Time Taken:', z)
|
||||||
|
|
||||||
|
# return render_template('index.html')
|
||||||
|
# # return 'ALL IMAGES MATCHED'
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/json')
|
||||||
|
def json():
|
||||||
|
p = './path.json'
|
||||||
|
return send_file(p, as_attachment=True)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(host="0.0.0.0",port=5001,debug=True)
|
||||||
İkili dosya gösterilmiyor.
İkili dosya gösterilmiyor.
İkili dosya gösterilmiyor.
@@ -0,0 +1,419 @@
|
|||||||
|
import pickle
|
||||||
|
import numpy as np
|
||||||
|
import face_recognition
|
||||||
|
import os
|
||||||
|
import cv2
|
||||||
|
import datetime
|
||||||
|
from main_application import *
|
||||||
|
eventid=str(Id[0])
|
||||||
|
Gallery='./Gallery/'+eventid+"/"
|
||||||
|
People='./Allunq_People/'+eventid+"/"+'568/'
|
||||||
|
# Gallery='D:\\DevelopmentNew\\web\\Web.Server\\wwwroot\\_files\\1\\CopyGallery\\'
|
||||||
|
# People='D:\\DevelopmentNew\\web\\Web.Server\\wwwroot\\_files\\People\\'
|
||||||
|
|
||||||
|
def predict(Gallery=Gallery,People=People):
|
||||||
|
x= datetime.datetime.now()
|
||||||
|
print('Execution Started at:',x)
|
||||||
|
|
||||||
|
def saveEncodings(encs, names, fname='encodings.pickle'):
|
||||||
|
"""
|
||||||
|
Save encodings in a pickle file to be used in future.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
encs : List of np arrays
|
||||||
|
List of face encodings.
|
||||||
|
names : List of strings
|
||||||
|
List of names for each face encoding.
|
||||||
|
fname : String, optional
|
||||||
|
Name/Location for pickle file. The default is "encodings.pickle".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = []
|
||||||
|
d = [{"name": nm, "encoding": enc} for (nm, enc) in zip(names, encs)]
|
||||||
|
data.extend(d)
|
||||||
|
|
||||||
|
encodingsFile = fname
|
||||||
|
|
||||||
|
# dump the facial encodings data to disk
|
||||||
|
print("[INFO] serializing encodings...")
|
||||||
|
f = open(encodingsFile, "wb")
|
||||||
|
f.write(pickle.dumps(data))
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
# Function to read encodings
|
||||||
|
|
||||||
|
def readEncodingsPickle(fname):
|
||||||
|
"""
|
||||||
|
Read Pickle file.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
fname : String
|
||||||
|
Name of pickle file.(Full location)
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
encodings : list of np arrays
|
||||||
|
list of all saved encodings
|
||||||
|
names : List of Strings
|
||||||
|
List of all saved names
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = pickle.loads(open(fname, "rb").read())
|
||||||
|
data = np.array(data)
|
||||||
|
encodings = [d["encoding"] for d in data]
|
||||||
|
names = [d["name"] for d in data]
|
||||||
|
return encodings, names
|
||||||
|
|
||||||
|
# Function to create encodings and get face locations
|
||||||
|
def createEncodings(image):
|
||||||
|
print("Encoding")
|
||||||
|
"""
|
||||||
|
Create face encodings for a given image and also return face locations in the given image.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to detect faces from.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
known_encodings : list of np array
|
||||||
|
List of face encodings in a given image
|
||||||
|
face_locations : list of tuples
|
||||||
|
list of tuples for face locations in a given image
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Find face locations for all faces in an image
|
||||||
|
face_locations = face_recognition.face_locations(image)
|
||||||
|
|
||||||
|
# Create encodings for all faces in an image
|
||||||
|
known_encodings = face_recognition.face_encodings(image, known_face_locations=face_locations)
|
||||||
|
return known_encodings, face_locations
|
||||||
|
|
||||||
|
# Function to compare encodings
|
||||||
|
def compareFaceEncodings(unknown_encoding, known_encodings, known_names):
|
||||||
|
"""
|
||||||
|
Compares face encodings to check if 2 faces are same or not.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
unknown_encoding : np array
|
||||||
|
Face encoding of unknown people.
|
||||||
|
known_encodings : np array
|
||||||
|
Face encodings of known people.
|
||||||
|
known_names : list of strings
|
||||||
|
Names of known people
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
acceptBool : Bool
|
||||||
|
face matched or not
|
||||||
|
duplicateName : String
|
||||||
|
Name of matched face
|
||||||
|
distance : Float
|
||||||
|
Distance between 2 faces
|
||||||
|
|
||||||
|
"""
|
||||||
|
duplicateName = ""
|
||||||
|
distance = 0.0
|
||||||
|
matches = face_recognition.compare_faces(known_encodings, unknown_encoding, tolerance=0.47)
|
||||||
|
|
||||||
|
face_distances = face_recognition.face_distance(known_encodings, unknown_encoding)
|
||||||
|
|
||||||
|
best_match_index = np.argmin(face_distances)
|
||||||
|
|
||||||
|
distance = face_distances[best_match_index]
|
||||||
|
if matches[best_match_index]:
|
||||||
|
acceptBool = True
|
||||||
|
duplicateName = known_names[best_match_index]
|
||||||
|
else:
|
||||||
|
acceptBool = False
|
||||||
|
duplicateName = ""
|
||||||
|
return acceptBool, duplicateName, distance
|
||||||
|
|
||||||
|
p = []
|
||||||
|
|
||||||
|
# Save Image to new directory
|
||||||
|
def saveImageToDirectory(image, name, imageName):
|
||||||
|
"""
|
||||||
|
Saves images to directory.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to save.
|
||||||
|
name : String
|
||||||
|
Directory where you want the image to be saved.
|
||||||
|
imageName : String
|
||||||
|
Name of image.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
path = "./people_Allunq_zero_maingallery/"+eventid+"/" + name
|
||||||
|
path1 = "./people_Allunq_zero_maingallery/"+eventid+"/" + name
|
||||||
|
if os.path.exists(path):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if not os.path.exists(path):
|
||||||
|
os.makedirs(path)
|
||||||
|
# os.mkdir(path,exist_ok=True)
|
||||||
|
cv2.imwrite(path + "/" + imageName, image)
|
||||||
|
x = []
|
||||||
|
c = (path1 + "/" + imageName)
|
||||||
|
x.append(c)
|
||||||
|
p.append(x)
|
||||||
|
|
||||||
|
# Function for creating encodings for known people
|
||||||
|
def processKnownPeopleImages(path=People, saveLocation="./people_copyGallery_known_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process images of known people and create face encodings to compare in future.
|
||||||
|
Eaach image should have just 1 face in it.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "C:/inetpub/vhosts/port82/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
known_encodings = []
|
||||||
|
known_names = []
|
||||||
|
for img in os.listdir(path):
|
||||||
|
imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(imgPath)
|
||||||
|
name = img.rsplit('.')[0]
|
||||||
|
# Resize
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
try:
|
||||||
|
known_encodings.append(encs[0])
|
||||||
|
except IndexError:
|
||||||
|
os.remove(People+img)
|
||||||
|
#known_encodings.append(encs[568])
|
||||||
|
known_names.append(name)
|
||||||
|
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
#cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
#cv2.destroyAllWindows()
|
||||||
|
saveEncodings(known_encodings, known_names, saveLocation)
|
||||||
|
|
||||||
|
# Function for processing dataset images
|
||||||
|
def processDatasetImages(saveLocation="./Gallery_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process image in dataset from where you want to separate images.
|
||||||
|
It separates the images into directories of known people, groups and any unknown people images.
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "D:/port1004/port1004/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Read pickle file for known people to compare faces from
|
||||||
|
people_encodings, names = readEncodingsPickle("./people_copyGallery_known_encodings.pickle")
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(Gallery, topdown=False):
|
||||||
|
|
||||||
|
for name in files:
|
||||||
|
s = os.path.join(root, name)
|
||||||
|
#print(p)
|
||||||
|
# imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(s)
|
||||||
|
orig = image.copy()
|
||||||
|
|
||||||
|
# Resize
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
|
||||||
|
# Save image to a group image folder if more than one face is in image
|
||||||
|
# if len(locs) > 1:
|
||||||
|
# saveImageToDirectory(orig, "Group", img)
|
||||||
|
|
||||||
|
# Processing image for each face
|
||||||
|
i = 0
|
||||||
|
knownFlag = 0
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
unknown_encoding = encs[i]
|
||||||
|
i += 1
|
||||||
|
acceptBool, duplicateName, distance = compareFaceEncodings(unknown_encoding, people_encodings, names)
|
||||||
|
if acceptBool:
|
||||||
|
saveImageToDirectory(orig, duplicateName,name)
|
||||||
|
knownFlag = 1
|
||||||
|
if knownFlag == 1:
|
||||||
|
print("Match Found")
|
||||||
|
else:
|
||||||
|
saveImageToDirectory(orig, "568",name)
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
# cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# # cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
# cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""
|
||||||
|
Main Function.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
processKnownPeopleImages()
|
||||||
|
processDatasetImages()
|
||||||
|
# import pandas as pd
|
||||||
|
# q = pd.DataFrame(p)
|
||||||
|
# df1 = q
|
||||||
|
# #print(df1)
|
||||||
|
# # df1.to_csv('m.csv')
|
||||||
|
|
||||||
|
# import pandas as pd
|
||||||
|
# import os
|
||||||
|
# c = []
|
||||||
|
# for root, dirs, files in os.walk(Gallery, topdown=False):
|
||||||
|
# for name in files:
|
||||||
|
# L = os.path.join(root, name)
|
||||||
|
# c.append(L)
|
||||||
|
# df2 = pd.DataFrame(c)
|
||||||
|
# # df.to_csv('oswalk.csv')
|
||||||
|
# import pandas as pd
|
||||||
|
# # df1 = pd.read_csv('m.csv')
|
||||||
|
# # df2 = pd.read_csv('oswalk.csv')
|
||||||
|
# df1 = df1[568].str.split('/', expand=True)
|
||||||
|
# df1.rename({df1.columns[-2]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
# df1.rename({df1.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
# df2 = df2[568].str.split("\\", expand=True)
|
||||||
|
# df2.rename({df2.columns[-1]: 'test'}, axis=1, inplace=True)
|
||||||
|
# df2.rename({df2.columns[-2]: 'EventName'}, axis=1, inplace=True)
|
||||||
|
# merge = pd.merge(df2, df1, on='test', how='left')
|
||||||
|
# mergesplit = merge.loc[:, 'test'].str.split(".", expand=True)
|
||||||
|
# mergesplit.rename({mergesplit.columns[-2]: 'ImageName'}, axis=1, inplace=True)
|
||||||
|
# mergesplit = mergesplit.loc[:, 'ImageName']
|
||||||
|
# merge['path'] = "/_files/1/Gallery/" + merge['EventName'] + '/' + merge['test']
|
||||||
|
# frames = [merge, mergesplit]
|
||||||
|
# r = pd.concat(frames, axis=1, join='inner')
|
||||||
|
# column_list = ['Matched', 'path', 'ImageName', 'EventName']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# r[column_list].to_csv('./csv/people_copygallery.csv', index=False)
|
||||||
|
|
||||||
|
# df1 = pd.read_csv('./csv/Zero_Gallery.csv')
|
||||||
|
# df2 = pd.read_csv('./csv/people_copygallery.csv')
|
||||||
|
# data = pd.concat([df1, df2], axis=568, join='inner')
|
||||||
|
# data.drop(data.index[data['Matched'] == 568], inplace=True)
|
||||||
|
# data.drop(data.index[data['Matched'] == '568'], inplace=True)
|
||||||
|
# data.to_csv('./csv/xtream.csv',index=False)
|
||||||
|
|
||||||
|
# import pandas as pd
|
||||||
|
# import re
|
||||||
|
# r = pd.read_csv('./csv/xtream.csv')
|
||||||
|
# r['unregistered'] = r['Matched']
|
||||||
|
# x = r['Matched'].to_list()
|
||||||
|
# file_lst = x
|
||||||
|
# try:
|
||||||
|
# final_list = [re.sub('[A-Za-z]+[\d]+[\w]*|[\d]+[A-Za-z]+[\w]*', '568', i) for i in file_lst]
|
||||||
|
# a = pd.DataFrame(final_list)
|
||||||
|
# # print(a)
|
||||||
|
# frames = [r, a]
|
||||||
|
# final = pd.concat(frames, axis=1, join='inner')
|
||||||
|
# final.rename({final.columns[-1]: 'registered'}, axis=1, inplace=True)
|
||||||
|
# final.loc[final["unregistered"] == final['registered'], "unregistered"] = 568
|
||||||
|
|
||||||
|
# # print(final)
|
||||||
|
# column_list = ['Matched', 'path', 'ImageName', 'EventName', 'registered', 'unregistered']
|
||||||
|
|
||||||
|
|
||||||
|
# final[column_list].to_csv('./csv/Events.csv', index=False)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# #final[column_list].to_json('path.json', orient="records")
|
||||||
|
# except TypeError:
|
||||||
|
# pass
|
||||||
|
# df1 = pd.read_csv('./csv/Events.csv')
|
||||||
|
# df2 = pd.read_csv('./csv/unique_people.csv')
|
||||||
|
# df2['Matched'] = df2['Matched'].astype(str)
|
||||||
|
# merge = pd.merge(df1, df2, on='Matched', how='left')
|
||||||
|
# column_list = ['registered', 'unregistered','Matched', 'croped_guest_pic','path', 'ImageName', 'EventName']
|
||||||
|
|
||||||
|
# merge[column_list].to_csv('./csv/EventXtream.csv', index=False)
|
||||||
|
# merge[column_list].to_json('./csv/EventXtream.json',orient = 'records')
|
||||||
|
# #print(merge)
|
||||||
|
# # merge.to_csv('EventXtream.csv',index=False)
|
||||||
|
import shutil
|
||||||
|
from shutil import copytree, Error
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk('./Allunq_People/568/'):
|
||||||
|
for file in files:
|
||||||
|
path_file = os.path.join(root, file)
|
||||||
|
try:
|
||||||
|
shutil.move(path_file, './ALL_UNQ/')
|
||||||
|
except shutil.Error as err:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print("Completed")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
# return render_template('index.html')
|
||||||
|
y=datetime.datetime.now()
|
||||||
|
print('Completed at:',y)
|
||||||
|
z=y-x
|
||||||
|
print('Time Taken:',z)
|
||||||
|
return (str(y-x))
|
||||||
|
#return 'ALL IMAGES MATCHED'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
predict()
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
|
||||||
|
# Python program to check if
|
||||||
|
# a directory contains file
|
||||||
|
|
||||||
|
import os
|
||||||
|
# directoryPath = "Copy_Gallery"
|
||||||
|
# for root, dirs, files in os.walk(directoryPath):
|
||||||
|
# for name in files:
|
||||||
|
# f = os.path.join(root, name)
|
||||||
|
# print(type(f))
|
||||||
|
# # if len(f)==568:
|
||||||
|
# # print("none")
|
||||||
|
# # else:
|
||||||
|
# # print("yes")
|
||||||
|
|
||||||
|
# Python program to check whether
|
||||||
|
# the directory empty or not
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
# path of the directory
|
||||||
|
path = "Copy_Gallery"
|
||||||
|
|
||||||
|
# Getting the list of directories
|
||||||
|
dir = os.listdir(path)
|
||||||
|
|
||||||
|
# Checking if the list is empty or not
|
||||||
|
if len(dir) == 0:
|
||||||
|
print("Empty directory")
|
||||||
|
else:
|
||||||
|
print("Not empty directory")
|
||||||
|
import glob
|
||||||
|
from os import listdir
|
||||||
|
|
||||||
|
for f in glob.glob("Copy_Gallery/*"):
|
||||||
|
if len(os.listdir(f))==0:
|
||||||
|
print("file not found")
|
||||||
|
else:
|
||||||
|
print("file found")
|
||||||
İkili dosya gösterilmiyor.
@@ -0,0 +1,88 @@
|
|||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
files = './front_face/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
files = './output_unique_ALLUNQ/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
|
||||||
|
files = './sepration_cluster/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
|
||||||
|
files = './sepration_crop/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
files = './unique_1/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
files = './Allunq_People/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
files = './people_Allunq_zero_maingallery/'
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
# files = './unique_1/'
|
||||||
|
|
||||||
|
# for root, dirs, files in os.walk(files):
|
||||||
|
# for f in files:
|
||||||
|
# os.unlink(os.path.join(root, f))
|
||||||
|
# for d in dirs:
|
||||||
|
# shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
# files = './Copy_Gallery/'
|
||||||
|
#
|
||||||
|
# for root, dirs, files in os.walk(files):
|
||||||
|
# for f in files:
|
||||||
|
# os.unlink(os.path.join(root, f))
|
||||||
|
# for d in dirs:
|
||||||
|
# shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
os.remove('known_encodings.pickle')
|
||||||
|
os.remove('people_copyGallery_known_encodings.pickle')
|
||||||
|
os.remove('Zero_gallery_known_encodings.pickle')
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
import sys
|
||||||
|
import os
|
||||||
|
import dlib
|
||||||
|
import glob
|
||||||
|
import time
|
||||||
|
import uuid
|
||||||
|
from main_application import *
|
||||||
|
|
||||||
|
import click
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
|
||||||
|
def sep_clust(eventid):
|
||||||
|
Gallery = 'C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\front_face\\' + eventid + "\\"
|
||||||
|
start = time.time()
|
||||||
|
|
||||||
|
# if len(sys.argv) != 3:
|
||||||
|
# print("Please specify valid arguments. Call the program like this \npython face_clustering.py -specify input folder- -specify output path-")
|
||||||
|
# exit()
|
||||||
|
|
||||||
|
predictor_path = 'C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\model\\shape_predictor_68_face_landmarks.dat'
|
||||||
|
face_rec_model_path = 'C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\model\\dlib_face_recognition_resnet_model_v1.dat'
|
||||||
|
# faces_folder_path = sys.argv[1]
|
||||||
|
output_folder = 'C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\sepration_cluster\\' + eventid + "\\"
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
files = output_folder
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(files):
|
||||||
|
for f in files:
|
||||||
|
os.unlink(os.path.join(root, f))
|
||||||
|
for d in dirs:
|
||||||
|
shutil.rmtree(os.path.join(root, d))
|
||||||
|
|
||||||
|
|
||||||
|
detector = dlib.get_frontal_face_detector() # a detector to find the faces
|
||||||
|
sp = dlib.shape_predictor(predictor_path) # shape predictor to find face landmarks
|
||||||
|
facerec = dlib.face_recognition_model_v1(face_rec_model_path) # face recognition model
|
||||||
|
|
||||||
|
descriptors = []
|
||||||
|
images = []
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(Gallery, topdown=False):
|
||||||
|
|
||||||
|
for name in files:
|
||||||
|
f = os.path.join(root, name)
|
||||||
|
|
||||||
|
# Load the images from input folder
|
||||||
|
# for f in glob.glob(os.path.join(faces_folder_path, "*")):
|
||||||
|
print("Processing file: {}".format(f))
|
||||||
|
img = dlib.load_rgb_image(f)
|
||||||
|
|
||||||
|
# Ask the detector to find the bounding boxes of each face. The 1 in the second argument indicates that we should upsample the image 1 time. This will make everything bigger and allow us to detect more faces.
|
||||||
|
dets = detector(img, 1)
|
||||||
|
print("Number of faces detected: {}".format(len(dets)))
|
||||||
|
|
||||||
|
# Now process each face we found.
|
||||||
|
for k, d in enumerate(dets):
|
||||||
|
# Get the landmarks/parts for the face in box d.
|
||||||
|
shape = sp(img, d)
|
||||||
|
|
||||||
|
# Compute the 128D vector that describes the face in img identified by shape.
|
||||||
|
face_descriptor = facerec.compute_face_descriptor(img, shape)
|
||||||
|
descriptors.append(face_descriptor)
|
||||||
|
images.append((img, shape))
|
||||||
|
|
||||||
|
# Cluster the faces.
|
||||||
|
labels = dlib.chinese_whispers_clustering(descriptors, 0.40)
|
||||||
|
num_classes = len(set(labels)) # Total number of clusters
|
||||||
|
print("Number of clusters: {}".format(num_classes))
|
||||||
|
|
||||||
|
for i in range(0, num_classes):
|
||||||
|
indices = []
|
||||||
|
class_length = len([label for label in labels if label == i])
|
||||||
|
for j, label in enumerate(labels):
|
||||||
|
if label == i:
|
||||||
|
indices.append(j)
|
||||||
|
print("Indices of images in the cluster {0} : {1}".format(str(i), str(indices)))
|
||||||
|
print("Size of cluster {0} : {1}".format(str(i), str(class_length)))
|
||||||
|
output_folder_path = output_folder + str(i) # Output folder for each cluster
|
||||||
|
os.path.normpath(output_folder_path)
|
||||||
|
os.makedirs(output_folder_path)
|
||||||
|
|
||||||
|
# Save each face to the respective cluster folder
|
||||||
|
print("Saving faces to output folder...")
|
||||||
|
for k, index in enumerate(indices):
|
||||||
|
img, shape = images[index]
|
||||||
|
x = img
|
||||||
|
|
||||||
|
# file_path2=os.path.join("C:/Users/katku/Desktop/spyder/192.168.89.91_windows/final_crop_cluster_FaceRecognition/unique/",str(uuid.uuid4().hex[:15])+str(i))
|
||||||
|
file_path = os.path.join(output_folder_path, str(uuid.uuid4().hex[:15]) + str(k) + str(i))
|
||||||
|
# dlib.save_face_chip(img, shape, file_path2, size=150, padding=568.25)
|
||||||
|
dlib.save_face_chip(img, shape, file_path, size=150, padding=0.25)
|
||||||
|
|
||||||
|
print("--- %s seconds ---" % (time.time() - start))
|
||||||
|
|
||||||
|
sep_clust()
|
||||||
|
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# What is the code to do : Extract faces from all image files in 'directory' and save them in 'out_src'.
|
||||||
|
import os
|
||||||
|
# - pip install ObjectExtractor ( OR pip3 install ObjectExtractor)
|
||||||
|
from main_application import *
|
||||||
|
from object_extractor import Extractor, FRONTALFACE_ALT2
|
||||||
|
import uuid
|
||||||
|
import main_application
|
||||||
|
import click
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
def crop(eventid):
|
||||||
|
|
||||||
|
|
||||||
|
# original_working_directory = os.getcwd()
|
||||||
|
# new_networked_directory = r'\\192.168.88.99\\Bizgaze\\port6003\\wwwroot\\_files\\'
|
||||||
|
# # change to the networked directory
|
||||||
|
# os.chdir(new_networked_directory)
|
||||||
|
|
||||||
|
|
||||||
|
CURRENT_PATH = os.path.dirname(__file__)
|
||||||
|
# extensions = ['jpeg', 'png']
|
||||||
|
|
||||||
|
inputImg = 'Z:\\1\\CopyGallery\\' + eventid + "\\"
|
||||||
|
out_src = '.\\sepration_crop\\' + eventid + "\\"
|
||||||
|
|
||||||
|
index = 1
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(inputImg, topdown=False):
|
||||||
|
for name in files:
|
||||||
|
f = os.path.join(root, name)
|
||||||
|
Extractor.extract(os.path.join(CURRENT_PATH, f), cascade_file=FRONTALFACE_ALT2,
|
||||||
|
output_directory=os.path.join(CURRENT_PATH, out_src),
|
||||||
|
output_prefix=str(uuid.uuid4().hex[:15]) + str(index),
|
||||||
|
start_count=1)
|
||||||
|
#os.remove(f)
|
||||||
|
index = index + 1
|
||||||
|
|
||||||
|
|
||||||
|
crop()
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Sample Code</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Opening a folder from HTML code</h1>
|
||||||
|
<a href='/home/bizgaze/PycharmProjects/img/output'>Click to open a folder</a>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Title</title>
|
||||||
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
|
||||||
|
integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<h1 class="page-header">Gallery</h1>
|
||||||
|
</div>
|
||||||
|
<a class="button button5"href="/">HOME</a>
|
||||||
|
<hr>
|
||||||
|
{% for image_name in image_names %}
|
||||||
|
<div class="col-lg-3 col-md-4 col-xs-6 thumb">
|
||||||
|
<img class="img-responsive" src=" {{url_for('send_image', filename=image_name )}}"style="width:300px;height:300px;">
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
|
||||||
|
integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS"
|
||||||
|
crossorigin="anonymous"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
.button {
|
||||||
|
background-color: #000000; /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div style="background-image: url('https://lh3.googleusercontent.com/p/AF1QipONWF8G50u9Bu-dklcj3kzesofOn8Z0q0LdHeU1=w1080-h608-p-no-v0');
|
||||||
|
/* Full height */
|
||||||
|
height: 100%;
|
||||||
|
/ Center and scale the image nicely /
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br> <br>
|
||||||
|
|
||||||
|
<form action="/upload" method="POST" enctype="multipart/form-data">
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="custom-file">
|
||||||
|
|
||||||
|
<input type="file" class="button button5" name="image" id="image"> <br> <br><br>
|
||||||
|
<div class="bg"></div>
|
||||||
|
<input class="button button5" type="submit"> <br><br></div></div></form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form action="{{ url_for('predict') }}" method="GET">
|
||||||
|
<input type="submit" class="button button5" value="predict"></form>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<form action="{{ url_for('json') }}" method="GET">
|
||||||
|
<input type="submit" class="button button5" value="json"></form>
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height:100%;
|
||||||
|
font-family: 'Helvetica';
|
||||||
|
background-color:#000000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align:center;
|
||||||
|
letter-spacing:1.4px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
################################## Selection first file from all folder #######################
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
import click
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
def unq1(eventid):
|
||||||
|
p1 = r"C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\sepration_cluster\\" + eventid + "\\"
|
||||||
|
p2 = r"C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\unique_1\\" + eventid + "\\"
|
||||||
|
|
||||||
|
for path, folders, files in os.walk(p1):
|
||||||
|
|
||||||
|
if not files: continue
|
||||||
|
try:
|
||||||
|
src = os.path.join(path, files[0])
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
dst_path = path.replace(p1, '') + os.sep
|
||||||
|
# dst_folder = p2 + dst_path
|
||||||
|
|
||||||
|
# create the target dir if doesn't exist
|
||||||
|
# if not os.path.exists(dst_folder):
|
||||||
|
# os.makedirs(dst_folder)
|
||||||
|
|
||||||
|
# create dst file with only the first file
|
||||||
|
try:
|
||||||
|
dst = p2 + files[0]
|
||||||
|
except IndexError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# copy the file
|
||||||
|
shutil.copy2(src, dst)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
unq1()
|
||||||
|
|
||||||
@@ -0,0 +1,352 @@
|
|||||||
|
import pickle
|
||||||
|
import numpy as np
|
||||||
|
import face_recognition
|
||||||
|
import os
|
||||||
|
import cv2
|
||||||
|
import datetime
|
||||||
|
import click
|
||||||
|
@click.command()
|
||||||
|
@click.argument('eventid', default='')
|
||||||
|
|
||||||
|
|
||||||
|
def predict(eventid):
|
||||||
|
|
||||||
|
|
||||||
|
Gallery = 'C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\unique_1\\' + eventid + "\\"
|
||||||
|
People = './ALL_UNQ/' + eventid + "/"
|
||||||
|
x= datetime.datetime.now()
|
||||||
|
print('Execution Started at:',x)
|
||||||
|
|
||||||
|
def saveEncodings(encs, names, fname='encodings.pickle'):
|
||||||
|
"""
|
||||||
|
Save encodings in a pickle file to be used in future.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
encs : List of np arrays
|
||||||
|
List of face encodings.
|
||||||
|
names : List of strings
|
||||||
|
List of names for each face encoding.
|
||||||
|
fname : String, optional
|
||||||
|
Name/Location for pickle file. The default is "encodings.pickle".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = []
|
||||||
|
d = [{"name": nm, "encoding": enc} for (nm, enc) in zip(names, encs)]
|
||||||
|
data.extend(d)
|
||||||
|
|
||||||
|
encodingsFile = fname
|
||||||
|
|
||||||
|
# dump the facial encodings data to disk
|
||||||
|
print("[INFO] serializing encodings...")
|
||||||
|
f = open(encodingsFile, "wb")
|
||||||
|
f.write(pickle.dumps(data))
|
||||||
|
f.close()
|
||||||
|
|
||||||
|
# Function to read encodings
|
||||||
|
|
||||||
|
def readEncodingsPickle(fname):
|
||||||
|
"""
|
||||||
|
Read Pickle file.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
fname : String
|
||||||
|
Name of pickle file.(Full location)
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
encodings : list of np arrays
|
||||||
|
list of all saved encodings
|
||||||
|
names : List of Strings
|
||||||
|
List of all saved names
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
data = pickle.loads(open(fname, "rb").read())
|
||||||
|
data = np.array(data)
|
||||||
|
encodings = [d["encoding"] for d in data]
|
||||||
|
names = [d["name"] for d in data]
|
||||||
|
return encodings, names
|
||||||
|
|
||||||
|
# Function to create encodings and get face locations
|
||||||
|
def createEncodings(image):
|
||||||
|
print("Encoding")
|
||||||
|
"""
|
||||||
|
Create face encodings for a given image and also return face locations in the given image.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to detect faces from.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
known_encodings : list of np array
|
||||||
|
List of face encodings in a given image
|
||||||
|
face_locations : list of tuples
|
||||||
|
list of tuples for face locations in a given image
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Find face locations for all faces in an image
|
||||||
|
face_locations = face_recognition.face_locations(image)
|
||||||
|
|
||||||
|
# Create encodings for all faces in an image
|
||||||
|
known_encodings = face_recognition.face_encodings(image, known_face_locations=face_locations)
|
||||||
|
return known_encodings, face_locations
|
||||||
|
|
||||||
|
# Function to compare encodings
|
||||||
|
def compareFaceEncodings(unknown_encoding, known_encodings, known_names):
|
||||||
|
"""
|
||||||
|
Compares face encodings to check if 2 faces are same or not.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
unknown_encoding : np array
|
||||||
|
Face encoding of unknown people.
|
||||||
|
known_encodings : np array
|
||||||
|
Face encodings of known people.
|
||||||
|
known_names : list of strings
|
||||||
|
Names of known people
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
acceptBool : Bool
|
||||||
|
face matched or not
|
||||||
|
duplicateName : String
|
||||||
|
Name of matched face
|
||||||
|
distance : Float
|
||||||
|
Distance between 2 faces
|
||||||
|
|
||||||
|
"""
|
||||||
|
duplicateName = ""
|
||||||
|
distance = 0.0
|
||||||
|
matches = face_recognition.compare_faces(known_encodings, unknown_encoding, tolerance=0.47)
|
||||||
|
|
||||||
|
face_distances = face_recognition.face_distance(known_encodings, unknown_encoding)
|
||||||
|
|
||||||
|
best_match_index = np.argmin(face_distances)
|
||||||
|
|
||||||
|
distance = face_distances[best_match_index]
|
||||||
|
if matches[best_match_index]:
|
||||||
|
acceptBool = True
|
||||||
|
duplicateName = known_names[best_match_index]
|
||||||
|
else:
|
||||||
|
acceptBool = False
|
||||||
|
duplicateName = ""
|
||||||
|
return acceptBool, duplicateName, distance
|
||||||
|
|
||||||
|
p = []
|
||||||
|
|
||||||
|
# Save Image to new directory
|
||||||
|
def saveImageToDirectory(image, name, imageName):
|
||||||
|
"""
|
||||||
|
Saves images to directory.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
image : cv2 mat
|
||||||
|
Image you want to save.
|
||||||
|
name : String
|
||||||
|
Directory where you want the image to be saved.
|
||||||
|
imageName : String
|
||||||
|
Name of image.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
path = "C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\output_unique_ALLUNQ\\" + name
|
||||||
|
path1 = "C:\\Users\\Administrator\\Documents\\AI\\runtimecropimages\\output_unique_ALLUNQ\\" + name
|
||||||
|
if os.path.exists(path):
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if not os.path.exists(path):
|
||||||
|
os.makedirs(path)
|
||||||
|
# os.mkdir(path,exist_ok=True)
|
||||||
|
cv2.imwrite(path + "/" + imageName, image)
|
||||||
|
x = []
|
||||||
|
c = (path1 + "/" + imageName)
|
||||||
|
x.append(c)
|
||||||
|
p.append(x)
|
||||||
|
|
||||||
|
# Function for creating encodings for known people
|
||||||
|
def processKnownPeopleImages(path=People, saveLocation="./known_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process images of known people and create face encodings to compare in future.
|
||||||
|
Eaach image should have just 1 face in it.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "C:/inetpub/vhosts/port82/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
known_encodings = []
|
||||||
|
known_names = []
|
||||||
|
for img in os.listdir(path):
|
||||||
|
imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(imgPath)
|
||||||
|
name = img.rsplit('.')[0]
|
||||||
|
# Resize
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
try:
|
||||||
|
known_encodings.append(encs[0])
|
||||||
|
except IndexError:
|
||||||
|
os.remove(People+img)
|
||||||
|
#known_encodings.append(encs[568])
|
||||||
|
known_names.append(name)
|
||||||
|
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
#cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
#cv2.destroyAllWindows()
|
||||||
|
saveEncodings(known_encodings, known_names, saveLocation)
|
||||||
|
|
||||||
|
# Function for processing dataset images
|
||||||
|
def processDatasetImages(saveLocation="./Gallery_encodings.pickle"):
|
||||||
|
"""
|
||||||
|
Process image in dataset from where you want to separate images.
|
||||||
|
It separates the images into directories of known people, groups and any unknown people images.
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
path : STRING, optional
|
||||||
|
Path for known people dataset. The default is "D:/port1004/port1004/wwwroot/_files/People".
|
||||||
|
It should be noted that each image in this dataset should contain only 1 face.
|
||||||
|
saveLocation : STRING, optional
|
||||||
|
Path for storing encodings for known people dataset. The default is "./known_encodings.pickle in current directory".
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
# Read pickle file for known people to compare faces from
|
||||||
|
people_encodings, names = readEncodingsPickle("./known_encodings.pickle")
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(Gallery, topdown=False):
|
||||||
|
|
||||||
|
for name in files:
|
||||||
|
s = os.path.join(root, name)
|
||||||
|
#print(p)
|
||||||
|
# imgPath = path + img
|
||||||
|
|
||||||
|
# Read image
|
||||||
|
image = cv2.imread(s)
|
||||||
|
try:
|
||||||
|
orig = image.copy()
|
||||||
|
image = cv2.resize(image, (0, 0), fx=0.9, fy=0.9, interpolation=cv2.INTER_LINEAR)
|
||||||
|
except AttributeError:
|
||||||
|
os.remove(s)
|
||||||
|
# Resize
|
||||||
|
|
||||||
|
|
||||||
|
# Get locations and encodings
|
||||||
|
encs, locs = createEncodings(image)
|
||||||
|
|
||||||
|
# Save image to a group image folder if more than one face is in image
|
||||||
|
# if len(locs) > 1:
|
||||||
|
# saveImageToDirectory(orig, "Group", img)
|
||||||
|
|
||||||
|
# Processing image for each face
|
||||||
|
i = 0
|
||||||
|
knownFlag = 0
|
||||||
|
for loc in locs:
|
||||||
|
top, right, bottom, left = loc
|
||||||
|
unknown_encoding = encs[i]
|
||||||
|
i += 1
|
||||||
|
acceptBool, duplicateName, distance = compareFaceEncodings(unknown_encoding, people_encodings, names)
|
||||||
|
if acceptBool:
|
||||||
|
saveImageToDirectory(orig, duplicateName,name)
|
||||||
|
knownFlag = 1
|
||||||
|
if knownFlag == 1:
|
||||||
|
print("Match Found")
|
||||||
|
else:
|
||||||
|
saveImageToDirectory(orig, "568",name)
|
||||||
|
|
||||||
|
# Show Image
|
||||||
|
# cv2.rectangle(image, (left, top), (right, bottom), color=(255, 568, 568), thickness=2)
|
||||||
|
# # cv2.imshow("Image", image)
|
||||||
|
# cv2.waitKey(1)
|
||||||
|
# cv2.destroyAllWindows()
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""
|
||||||
|
Main Function.
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
None.
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
processKnownPeopleImages()
|
||||||
|
processDatasetImages()
|
||||||
|
# import pandas as pd
|
||||||
|
# q = pd.DataFrame(p)
|
||||||
|
# m = q
|
||||||
|
# # print(m)
|
||||||
|
# # x.drop(x.columns[Unnam], axis=1, inplace=True)
|
||||||
|
# df = m.groupby([568], as_index=False).count()
|
||||||
|
# z = df[568].str.split('/', expand=True)
|
||||||
|
# z.rename({z.columns[-2]: 'Matched'}, axis=1, inplace=True)
|
||||||
|
# z.rename({z.columns[-1]: 'croped_guest_pic'}, axis=1, inplace=True)
|
||||||
|
|
||||||
|
# #z = z.iloc[:, 3:]
|
||||||
|
# z.to_csv('unique_people.csv')
|
||||||
|
# z=pd.read_csv('unique_people.csv')
|
||||||
|
|
||||||
|
# #z.drop(z.index[z['Matched'] == 568], inplace=True)
|
||||||
|
# z = z.iloc[:, 3:]
|
||||||
|
# z['Matched'] = z['Matched'].apply(str)
|
||||||
|
# z.to_csv('unique_people.csv',index=False)
|
||||||
|
|
||||||
|
# import os
|
||||||
|
# import shutil
|
||||||
|
|
||||||
|
# for root, dirs, files in os.walk('./output_unique_ALLUNQ/'+eventid+'/568/'):
|
||||||
|
# for file in files:
|
||||||
|
# path_file = os.path.join(root, file)
|
||||||
|
# shutil.move(path_file, './ALL_UNQ/'+eventid+"/")
|
||||||
|
print("Completed")
|
||||||
|
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
|
||||||
|
# return render_template('index.html')
|
||||||
|
y=datetime.datetime.now()
|
||||||
|
print('Completed at:',y)
|
||||||
|
z=y-x
|
||||||
|
print('Time Taken:',z)
|
||||||
|
return (str(y-x))
|
||||||
|
#return 'ALL IMAGES MATCHED'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
predict()
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
"lang":"en",
|
||||||
|
"name":"model",
|
||||||
|
"version":"0.0.0",
|
||||||
|
"spacy_version":">=2.3.5",
|
||||||
|
"description":"",
|
||||||
|
"author":"",
|
||||||
|
"email":"",
|
||||||
|
"url":"",
|
||||||
|
"license":"",
|
||||||
|
"spacy_git_version":"1d4b1dea2",
|
||||||
|
"vectors":{
|
||||||
|
"width":0,
|
||||||
|
"vectors":0,
|
||||||
|
"keys":0,
|
||||||
|
"name":"spacy_pretrained_vectors"
|
||||||
|
},
|
||||||
|
"pipeline":[
|
||||||
|
"ner"
|
||||||
|
],
|
||||||
|
"factories":{
|
||||||
|
"ner":"ner"
|
||||||
|
},
|
||||||
|
"labels":{
|
||||||
|
"ner":[
|
||||||
|
"Bank Account No",
|
||||||
|
"Bank Name",
|
||||||
|
"Due Date",
|
||||||
|
"Grand Total",
|
||||||
|
"Invoice Date",
|
||||||
|
"Invoice No",
|
||||||
|
"RTGS/IFSC Code",
|
||||||
|
"Round Off"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"beam_width":1,
|
||||||
|
"beam_density":0.0,
|
||||||
|
"beam_update_prob":1.0,
|
||||||
|
"cnn_maxout_pieces":3,
|
||||||
|
"nr_feature_tokens":6,
|
||||||
|
"nr_class":34,
|
||||||
|
"hidden_depth":1,
|
||||||
|
"token_vector_width":96,
|
||||||
|
"hidden_width":64,
|
||||||
|
"maxout_pieces":2,
|
||||||
|
"pretrained_vectors":null,
|
||||||
|
"bilstm_depth":0,
|
||||||
|
"self_attn_depth":0,
|
||||||
|
"conv_depth":4,
|
||||||
|
"conv_window":1,
|
||||||
|
"embed_size":2000
|
||||||
|
}
|
||||||
İkili dosya gösterilmiyor.
@@ -0,0 +1 @@
|
|||||||
|
�¥movesÚP{"0":{},"1":{"Invoice No":-1,"Invoice Date":-2,"Grand Total":-3,"Bank Name":-4,"Bank Account No":-5,"RTGS/IFSC Code":-6,"Due Date":-7,"Round Off":-8},"2":{"Invoice No":-1,"Invoice Date":-2,"Grand Total":-3,"Bank Name":-4,"Bank Account No":-5,"RTGS/IFSC Code":-6,"Due Date":-7,"Round Off":-8},"3":{"Invoice No":-1,"Invoice Date":-2,"Grand Total":-3,"Bank Name":-4,"Bank Account No":-5,"RTGS/IFSC Code":-6,"Due Date":-7,"Round Off":-8},"4":{"":1,"Invoice No":-1,"Invoice Date":-2,"Grand Total":-3,"Bank Name":-4,"Bank Account No":-5,"RTGS/IFSC Code":-6,"Due Date":-7,"Round Off":-8},"5":{"":1}}
|
||||||
Dosya farkları bir veya daha fazla satır çok uzun olduğundan bastırıldı
@@ -0,0 +1 @@
|
|||||||
|
�
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
�«lexeme_norm€
|
||||||
Dosya farkı çok büyük olduğundan ihmal edildi
Fark Yükle
İkili dosya gösterilmiyor.
@@ -0,0 +1,48 @@
|
|||||||
|
Key,Values
|
||||||
|
SELLER NAME,Seller : SHREE TRADING CORPORATION
|
||||||
|
SELLER ADDRESS,"6 & 7 Shree Sita Gaushala , Paharganj, Ajmer, Rajasthan - 305001"
|
||||||
|
SELLER PH,Phone: 9610566688
|
||||||
|
SELLER EMAIL,Email : stc.jaipur@gmail.com
|
||||||
|
SELLER GST,GST No. : 08AAVPM5307P1ZV
|
||||||
|
SELLER PAN,PAN No. : AAVPM5307P
|
||||||
|
BUYER NAME,Buyer : Gurukripa Automobiles
|
||||||
|
BUYER ADDRESS,"Ajmer Front Of Central Jail, Jaipur Road, Ajmer, 305001"
|
||||||
|
BUYER GST,GST No. :Un Registered
|
||||||
|
INVOICE NO,Invoice No. : AJM21-22/XM00444
|
||||||
|
INVOICE DATE,Date : 06 Aug 2021
|
||||||
|
SHIP TO,"Ship to : , , "
|
||||||
|
BUYER GST,GST No. :Un Registered
|
||||||
|
SHIP TO CONTACT,"Contact: Sunil,8955050479"
|
||||||
|
DESTINATION,Destination Terms
|
||||||
|
SI,1
|
||||||
|
HSN,27101980
|
||||||
|
PRODUCT,MOBIL SUPER HP 10W-30 CTN 4X4L:IN-
|
||||||
|
PACK SIZE,1
|
||||||
|
QUANTITY,16.00 LTR
|
||||||
|
RATE,222.88
|
||||||
|
DISC,160
|
||||||
|
TAX %,9%|9%
|
||||||
|
AMOUNT,3406.1
|
||||||
|
SI,2
|
||||||
|
HSN,27101980
|
||||||
|
PRODUCT,MOBIL SUPER MGDO 15W-40 CTN 4X3.5L:IN-
|
||||||
|
PACK SIZE,6
|
||||||
|
QUANTITY,84.00 LTR
|
||||||
|
RATE,220.58
|
||||||
|
DISC,2100
|
||||||
|
TAX %,9%|9%
|
||||||
|
AMOUNT,16428.8
|
||||||
|
TOTAL PACKS & QUANTITY,Total Quantity 7.00 100.00
|
||||||
|
ASSESSABLE AMOUNT,Assessable Amount 19834.90
|
||||||
|
AMOUNT IN WORDS,Amount in words : Rupees Twenty Three Thousand Four Hundred Five only
|
||||||
|
PAYMENT ON OR BEFORE,Payment on or before Save To pay
|
||||||
|
OUTPUT SGST,Output SGST
|
||||||
|
OUTPUT CGST,1785.14 Output CGST
|
||||||
|
DISC,1785.14
|
||||||
|
ROUND OFF,Round off -0.18
|
||||||
|
RTS POINTS EARNED,RTS Points earned: 1200.00
|
||||||
|
OVERALL RTS POINTS,Overall RTS Points: 1758.00
|
||||||
|
GRAND TOTAL,Grand Total 23405.00
|
||||||
|
OUR BANK DETAILS,Our Bank Details : Kotak Mahindra Bank
|
||||||
|
BANK A/C NO,Bank A/c No. : 1412405384
|
||||||
|
RTGS/IFSC,RTGS / IFSC Code : KKBK0003540
|
||||||
|
@@ -0,0 +1,48 @@
|
|||||||
|
Key,Values
|
||||||
|
SELLERNAME,Seller : SHREE TRADING CORPORATION
|
||||||
|
SELLERADDRESS,"6 & 7 Shree Sita Gaushala , Paharganj, Ajmer, Rajasthan - 305001"
|
||||||
|
SELLERPH,Phone: 9610566688
|
||||||
|
SELLEREMAIL,Email : stc.jaipur@gmail.com
|
||||||
|
SELLERGST,GST No. : 08AAVPM5307P1ZV
|
||||||
|
SELLERPAN,PAN No. : AAVPM5307P
|
||||||
|
BUYERNAME,Buyer : Gurukripa Automobiles
|
||||||
|
BUYERADDRESS,"Ajmer Front Of Central Jail, Jaipur Road, Ajmer, 305001"
|
||||||
|
BUYERGST,GST No. :Un Registered
|
||||||
|
INVOICENO,Invoice No. : AJM21-22/XM00444
|
||||||
|
INVOICEDATE,Date : 06 Aug 2021
|
||||||
|
SHIPTO,"Ship to : , , "
|
||||||
|
BUYERGST,GST No. :Un Registered
|
||||||
|
SHIPTOCONTACT,"Contact: Sunil,8955050479"
|
||||||
|
DESTINATION,Destination Terms
|
||||||
|
SI,1
|
||||||
|
HSN,27101980
|
||||||
|
PRODUCT,MOBIL SUPER HP 10W-30 CTN 4X4L:IN-
|
||||||
|
PACKSIZE,1.00
|
||||||
|
QUANTITY,16.00 LTR
|
||||||
|
RATE,222.88
|
||||||
|
DISC,160.000
|
||||||
|
TAX%,9%|9%
|
||||||
|
AMOUNT,3406.10
|
||||||
|
SI,2
|
||||||
|
HSN,27101980
|
||||||
|
PRODUCT,MOBIL SUPER MGDO 15W-40 CTN 4X3.5L:IN-
|
||||||
|
PACKSIZE,6.00
|
||||||
|
QUANTITY,84.00 LTR
|
||||||
|
RATE,220.58
|
||||||
|
DISC,2100.000
|
||||||
|
TAX%,9%|9%
|
||||||
|
AMOUNT,16428.80
|
||||||
|
TOTALPACKS&QUANTITY,Total Quantity 7.00 100.00
|
||||||
|
ASSESSABLEAMOUNT,Assessable Amount 19834.90
|
||||||
|
AMOUNTINWORDS,Amount in words : Rupees Twenty Three Thousand Four Hundred Five only
|
||||||
|
PAYMENTONORBEFORE,Payment on or before Save To pay
|
||||||
|
OUTPUTSGST,Output SGST
|
||||||
|
OUTPUTCGST,1785.14 Output CGST
|
||||||
|
DISC,1785.14
|
||||||
|
ROUNDOFF,Round off -0.18
|
||||||
|
RTSPOINTSEARNED,RTS Points earned: 1200.00
|
||||||
|
OVERALLRTSPOINTS,Overall RTS Points: 1758.00
|
||||||
|
GRANDTOTAL,Grand Total 23405.00
|
||||||
|
OURBANKDETAILS,Our Bank Details : Kotak Mahindra Bank
|
||||||
|
BANKACNO,Bank A/c No. : 1412405384
|
||||||
|
RTGSIFSC,RTGS / IFSC Code : KKBK0003540
|
||||||
|
@@ -0,0 +1,20 @@
|
|||||||
|
Key
|
||||||
|
SELLERNAME
|
||||||
|
SELLERPH
|
||||||
|
SELLEREMAIL
|
||||||
|
SELLERGST
|
||||||
|
SELLERPAN
|
||||||
|
BUYERNAME
|
||||||
|
BUYERGST
|
||||||
|
BUYERPAN
|
||||||
|
INVOICENO
|
||||||
|
INVOICEDATE
|
||||||
|
PONO
|
||||||
|
SHIPTO
|
||||||
|
SHIPTOGST
|
||||||
|
SHIPTOCONTACT
|
||||||
|
DISC
|
||||||
|
OURBANKDETAILS
|
||||||
|
BANKACNO
|
||||||
|
RTGSIFSC
|
||||||
|
AMOUNTINWORDS
|
||||||
|
@@ -0,0 +1,30 @@
|
|||||||
|
Key
|
||||||
|
SELLERADDRESS
|
||||||
|
BUYERADDRESS
|
||||||
|
DESTINATION
|
||||||
|
SI
|
||||||
|
HSN
|
||||||
|
PRODUCT
|
||||||
|
PACKSIZE
|
||||||
|
QUANTITY
|
||||||
|
RATE
|
||||||
|
DISC
|
||||||
|
TAX%
|
||||||
|
AMOUNT
|
||||||
|
SI
|
||||||
|
HSN
|
||||||
|
PRODUCT
|
||||||
|
PACKSIZE
|
||||||
|
QUANTITY
|
||||||
|
RATE
|
||||||
|
DISC
|
||||||
|
TAX%
|
||||||
|
AMOUNT
|
||||||
|
TOTALPACKS&QUANTITY
|
||||||
|
PAYMENTONORBEFORE
|
||||||
|
PAYMENTTYPE
|
||||||
|
OUTPUTSGST
|
||||||
|
OUTPUTCGST
|
||||||
|
ROUNDOFF
|
||||||
|
GRANDTOTAL
|
||||||
|
ASSESSABLEAMOUNT
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
{"0":{"SELLERNAME":"SHREE TRADING CORPORATION","SELLERADDRESS":"6 & 7 Shree Sita Gaushala , Paharganj, Ajmer, Rajasthan - 305001","SELLERPH":9610566688,"SELLEREMAIL":"stc.jaipur@gmail.com","SELLERGST":"08AAVPM5307P1ZV","SELLERPAN":"AAVPM5307P","BUYERNAME":"Gurukripa Automobiles","BUYERADDRESS":"Ajmer Front Of Central Jail, Jaipur Road, Ajmer, 305001","BUYERGST":"Un Registered","INVOICENO":"AJM21-22\/XM00444","INVOICEDATE":"06 Aug 2021","SHIPTO":", ,","SHIPTOCONTACT":"Sunil,8955050479","DESTINATION":"Destination Terms","TOTALPACKS&QUANTITY":null,"ASSESSABLEAMOUNT":null,"AMOUNTINWORDS":"Rupees Twenty Three Thousand Four Hundred Five only","PAYMENTONORBEFORE":null,"OUTPUTSGST":null,"OUTPUTCGST":null,"ROUNDOFF":null,"RTSPOINTSEARNED":null,"OVERALLRTSPOINTS":null,"GRANDTOTAL":null,"OURBANKDETAILS":"Kotak Mahindra Bank","BANKACNO":1412405384,"RTGSIFSC":"KKBK0003540"}}
|
||||||
@@ -0,0 +1,427 @@
|
|||||||
|
afrom flask import Flask, render_template, send_file, request, redirect, Response
|
||||||
|
import spacy
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import pytesseract
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
import time
|
||||||
|
import multiprocessing
|
||||||
|
from PIL import Image
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
nlp_model1 = spacy.load("p")
|
||||||
|
app.config["IMAGE_UPLOADS"] = "/home/ubuntu/AI/InvoiceParser/upload_invoice"
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/", methods=["GET"])
|
||||||
|
def home():
|
||||||
|
return render_template("invoice.html")
|
||||||
|
|
||||||
|
|
||||||
|
# @app.route("/upload_invoice", methods=["GET", "POST"])
|
||||||
|
def predict(url_list):
|
||||||
|
# if request.method == "POST":
|
||||||
|
|
||||||
|
# if request.files:
|
||||||
|
|
||||||
|
# image = request.files["image"]
|
||||||
|
# try:
|
||||||
|
# image.save(os.path.join(app.config["IMAGE_UPLOADS"], image.filename))
|
||||||
|
# except IsADirectoryError:
|
||||||
|
# return render_template("invoice.html")
|
||||||
|
# # image.save(os.path.join(
|
||||||
|
# # app1.config["IMAGE_UPLOADS"], image.filename))
|
||||||
|
|
||||||
|
# print("Image saved in Invoice")
|
||||||
|
|
||||||
|
# return redirect(request.url)
|
||||||
|
Dataset = request.get_json()
|
||||||
|
# print(Dataset)
|
||||||
|
a = url_list
|
||||||
|
x = a['FileData']
|
||||||
|
# print(x)
|
||||||
|
y = a['FileName']
|
||||||
|
z = a['FileType']
|
||||||
|
name = y + '.' + z
|
||||||
|
print(name)
|
||||||
|
# print(y)
|
||||||
|
# image = y.split("/")
|
||||||
|
# filename=image[-1]
|
||||||
|
|
||||||
|
# print(x)
|
||||||
|
img_data = x.encode()
|
||||||
|
|
||||||
|
import base64
|
||||||
|
with open('/home/ubuntu/AI/InvoiceParser/upload_invoice/' + name, "wb") as fh:
|
||||||
|
fh.write(base64.decodebytes(img_data))
|
||||||
|
|
||||||
|
# Renaming file name
|
||||||
|
# os.chdir("/home/ubuntu/AI/InvoiceParser/upload_invoice/")
|
||||||
|
# print(os.getcwd())
|
||||||
|
#
|
||||||
|
# for count, f in enumerate(os.listdir()):
|
||||||
|
# f_name, f_ext = os.path.splitext(f)
|
||||||
|
# f_name = "" + str(count)
|
||||||
|
#
|
||||||
|
# new_name = f"{f_name}{f_ext}"
|
||||||
|
# os.rename(f, new_name)
|
||||||
|
import glob
|
||||||
|
ts = 0
|
||||||
|
for file_name in glob.glob("/home/ubuntu/AI/InvoiceParser/upload_invoice/*"):
|
||||||
|
fts = os.path.getmtime(file_name)
|
||||||
|
if fts > ts:
|
||||||
|
ts = fts
|
||||||
|
found = file_name
|
||||||
|
print(found)
|
||||||
|
|
||||||
|
s = "/home/ubuntu/AI/InvoiceParser/upload_invoice"
|
||||||
|
s = os.listdir(s)
|
||||||
|
for file in s:
|
||||||
|
if file.endswith(".jpg"):
|
||||||
|
fname = (found)
|
||||||
|
elif file.endswith(".png"):
|
||||||
|
fname = (found)
|
||||||
|
elif file.endswith(".pdf"):
|
||||||
|
fname = (found)
|
||||||
|
elif file.endswith(".jpeg"):
|
||||||
|
fname = (found)
|
||||||
|
elif file.endswith(".JPEG"):
|
||||||
|
fname = (found)
|
||||||
|
|
||||||
|
def img_to_pdf(): # png to editable pdf conversion
|
||||||
|
pdf = pytesseract.image_to_pdf_or_hocr(fname, extension="pdf")
|
||||||
|
with open(
|
||||||
|
"/home/ubuntu/AI/InvoiceParser/upload_invoice/demo.pdf",
|
||||||
|
"w+b",
|
||||||
|
) as f:
|
||||||
|
f.write(pdf)
|
||||||
|
|
||||||
|
if fname.endswith(".pdf"):
|
||||||
|
print()
|
||||||
|
else:
|
||||||
|
img_to_pdf()
|
||||||
|
fname = "/home/ubuntu/AI/InvoiceParser/upload_invoice/demo.pdf"
|
||||||
|
|
||||||
|
sourcepath = "/home/ubuntu/AI/InvoiceParser/upload_invoice"
|
||||||
|
sourcefiles = os.listdir(sourcepath)
|
||||||
|
destinationpath = "/home/ubuntu/AI/InvoiceParser/uploads"
|
||||||
|
for file in sourcefiles:
|
||||||
|
if file.endswith(".pdf"):
|
||||||
|
shutil.copy2(
|
||||||
|
os.path.join(sourcepath, file), os.path.join(destinationpath, file)
|
||||||
|
)
|
||||||
|
os.chdir("/home/ubuntu/AI/InvoiceParser/uploads")
|
||||||
|
print(os.getcwd())
|
||||||
|
print("file name conerted to o.pdf")
|
||||||
|
for count, f in enumerate(os.listdir()):
|
||||||
|
f_name, f_ext = os.path.splitext(f)
|
||||||
|
f_name = "" + str(count)
|
||||||
|
new_name = f"{f_name}{f_ext}"
|
||||||
|
os.rename(f, new_name)
|
||||||
|
|
||||||
|
import spacy
|
||||||
|
import sys
|
||||||
|
import fitz
|
||||||
|
|
||||||
|
fname = "/home/ubuntu/AI/InvoiceParser/uploads/0.pdf"
|
||||||
|
doc = fitz.open(fname)
|
||||||
|
text = ""
|
||||||
|
for page in doc:
|
||||||
|
text = text + str(page.get_text())
|
||||||
|
|
||||||
|
fitz = " ".join(text.split("\n"))
|
||||||
|
# print(fitz)
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
doc = nlp_model1(fitz)
|
||||||
|
k = []
|
||||||
|
l = []
|
||||||
|
for ent in doc.ents:
|
||||||
|
# print(f"{ent.label_.upper():{30}}- {ent.text}")
|
||||||
|
k.append(ent.label_.upper())
|
||||||
|
l.append(ent.text)
|
||||||
|
|
||||||
|
columns = k
|
||||||
|
rows = [l]
|
||||||
|
data = pd.DataFrame(rows, columns=columns)
|
||||||
|
df = data
|
||||||
|
|
||||||
|
df = data.T
|
||||||
|
|
||||||
|
df.to_csv("/home/ubuntu/AI/InvoiceParser/Invoice.csv")
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
df = pd.read_csv("/home/ubuntu/AI/InvoiceParser/Invoice.csv")
|
||||||
|
# df.head()
|
||||||
|
# df = df.T
|
||||||
|
# new_header = df.iloc[0] # grab the first row for the header
|
||||||
|
# df = df[1:] # take the data less the header row
|
||||||
|
# df.columns = new_header
|
||||||
|
|
||||||
|
# def df_column_uniquify(df):
|
||||||
|
# df_columns = df.columns
|
||||||
|
# new_columns = []
|
||||||
|
# for item in df_columns:
|
||||||
|
# counter = 0
|
||||||
|
# newitem = item
|
||||||
|
# while newitem in new_columns:
|
||||||
|
# counter += 1
|
||||||
|
# newitem = "{}_{}".format(item, counter)
|
||||||
|
# new_columns.append(newitem)
|
||||||
|
# df.columns = new_columns
|
||||||
|
# return df.T
|
||||||
|
|
||||||
|
# df = df_column_uniquify(df)
|
||||||
|
# # df=df.T
|
||||||
|
# df.to_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
#df = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
df.rename({df.columns[-2]: 'Key'}, axis=1, inplace=True)
|
||||||
|
df.rename({df.columns[-1]: 'Values'}, axis=1, inplace=True)
|
||||||
|
df['Key'] = df['Key'].str.replace('/', '')
|
||||||
|
df['Key'] = df['Key'].str.replace(' ', '')
|
||||||
|
df.to_csv('/home/ubuntu/AI/InvoiceParser/final.csv', index=False)
|
||||||
|
import pandas as pd
|
||||||
|
x1 = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/finalwithcolen.csv')
|
||||||
|
merge = pd.merge(x1, tp, on='Key', how='right')
|
||||||
|
merge1 = merge
|
||||||
|
merge = merge['Values'].str.split(":", expand=True)
|
||||||
|
merge.rename({merge.columns[-1]: 'Values'}, axis=1, inplace=True)
|
||||||
|
frames = [merge1['Key'], merge['Values']]
|
||||||
|
result = pd.concat(frames, axis=1)
|
||||||
|
|
||||||
|
x1 = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/finalwithoutcolen.csv')
|
||||||
|
merged = pd.merge(x1, tp, on='Key', how='right')
|
||||||
|
frames = [result, merged]
|
||||||
|
result1 = pd.concat(frames)
|
||||||
|
result1.to_csv('/home/ubuntu/AI/InvoiceParser/final1.csv', index=False)
|
||||||
|
|
||||||
|
x1 = pd.read_csv('/home/ubuntu/AI/InvoiceParser/main.csv')
|
||||||
|
tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final1.csv')
|
||||||
|
tp['Key'] = tp['Key'].str.strip()
|
||||||
|
tp['Values'] = tp['Values'].str.strip()
|
||||||
|
|
||||||
|
merge = pd.merge(tp, x1, on='Key', how='right')
|
||||||
|
merge.to_csv('/home/ubuntu/AI/InvoiceParser/invoicewithouttable.csv', index=False)
|
||||||
|
df2 = pd.read_csv('/home/ubuntu/AI/InvoiceParser/invoicewithouttable.csv')
|
||||||
|
|
||||||
|
# Import writer class from csv module
|
||||||
|
from csv import writer
|
||||||
|
|
||||||
|
|
||||||
|
List=['PlantCode'," "]
|
||||||
|
with open('/home/ubuntu/AI/InvoiceParser/invoicewithouttable.csv', 'a') as f_object:
|
||||||
|
writer_object = writer(f_object)
|
||||||
|
writer_object.writerow(List)
|
||||||
|
f_object.close()
|
||||||
|
# print(df2)
|
||||||
|
df2 = pd.read_csv('/home/ubuntu/AI/InvoiceParser/invoicewithouttable.csv')
|
||||||
|
df2 = df2.T
|
||||||
|
|
||||||
|
df2.to_csv('/home/ubuntu/AI/InvoiceParser/invoicewithouttable.csv', index=False, header=False)
|
||||||
|
|
||||||
|
df1 = pd.read_csv('/home/ubuntu/AI/InvoiceParser/invoicewithouttable.csv')
|
||||||
|
df1.to_json('/home/ubuntu/AI/InvoiceParser/firstjson.json', orient="index")
|
||||||
|
import pandas as pd
|
||||||
|
x = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/item1.csv')
|
||||||
|
x['Values'] = x['Values'].str.strip()
|
||||||
|
merge = pd.merge(tp, x, on='Key', how='inner')
|
||||||
|
merge = merge.groupby('Key').agg({
|
||||||
|
'Values': '/'.join,
|
||||||
|
}).reset_index()
|
||||||
|
z = merge['Values'].str.split('/', expand=True)
|
||||||
|
frames = [merge, z]
|
||||||
|
result1 = pd.concat(frames, axis=1)
|
||||||
|
result1 = result1.drop(['Values'], axis=1)
|
||||||
|
import pandas as pd
|
||||||
|
tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/item1.csv')
|
||||||
|
merge = pd.merge(tp, result1, on='Key', how='inner')
|
||||||
|
merge = merge.T
|
||||||
|
new_header = merge.iloc[0] # grab the first row for the header
|
||||||
|
merge = merge[1:] # take the data less the header row
|
||||||
|
merge.columns = new_header
|
||||||
|
|
||||||
|
merge = merge.to_dict('records')
|
||||||
|
invoice_Item=merge
|
||||||
|
|
||||||
|
|
||||||
|
# import pandas as pd
|
||||||
|
# import json
|
||||||
|
# dflist = []
|
||||||
|
# x = pd.read_csv('/home/ubuntu/AI/InvoiceParser/item1.csv')
|
||||||
|
# tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
# tp['Key']=tp['Key'].str.strip()
|
||||||
|
# tp['Values']=tp['Values'].str.strip()
|
||||||
|
# # tp = tp.loc[:, ~tp.columns.str.contains('^Unnamed')]
|
||||||
|
# merge = pd.merge(x, tp, on='Key', how='left')
|
||||||
|
# merge.to_csv('/home/ubuntu/AI/InvoiceParser/invoicewithtable1.csv', index=False)
|
||||||
|
|
||||||
|
# dfPG = pd.read_csv('/home/ubuntu/AI/InvoiceParser/invoicewithtable1.csv')
|
||||||
|
# import numpy as np
|
||||||
|
# dfPG = dfPG.replace({np.nan: None})
|
||||||
|
# x2 = dfPG.iloc[:, -2].tolist()
|
||||||
|
# y2 = dfPG.iloc[:, -1].tolist()
|
||||||
|
# z1 = dict(zip(x2, y2))
|
||||||
|
# dflist.append(z1)
|
||||||
|
# # u1 = json.dumps(z1)
|
||||||
|
# import pandas as pd
|
||||||
|
|
||||||
|
# x = pd.read_csv('/home/ubuntu/AI/InvoiceParser/item2.csv')
|
||||||
|
# tp = pd.read_csv('/home/ubuntu/AI/InvoiceParser/final.csv')
|
||||||
|
# tp['Key']=tp['Key'].str.strip()
|
||||||
|
# tp['Values']=tp['Values'].str.strip()
|
||||||
|
# # tp = tp.loc[:, ~tp.columns.str.contains('^Unnamed')]
|
||||||
|
# merge = pd.merge(x, tp, on='Key', how='left')
|
||||||
|
# merge.to_csv('/home/ubuntu/AI/InvoiceParser/invoicewithtable2.csv', index=False)
|
||||||
|
|
||||||
|
# dfUG = pd.read_csv('/home/ubuntu/AI/InvoiceParser/invoicewithtable2.csv')
|
||||||
|
# import numpy as np
|
||||||
|
# dfUG = dfUG.replace({np.nan: None})
|
||||||
|
# x2 = dfUG.iloc[:, -2].tolist()
|
||||||
|
# y2 = dfUG.iloc[:, -1].tolist()
|
||||||
|
# z2 = dict(zip(x2, y2))
|
||||||
|
# dflist.append(z2)
|
||||||
|
# u2 = json.dumps(z2)
|
||||||
|
# final = '[' + str(z1) + ',' + str(z2) + ']'
|
||||||
|
# return render_template('resume.html')
|
||||||
|
############################################Document############################################################
|
||||||
|
|
||||||
|
import base64
|
||||||
|
empty = []
|
||||||
|
name = found
|
||||||
|
image = open(name, 'rb')
|
||||||
|
image_read = image.read()
|
||||||
|
image_64_encode = base64.b64encode(image_read)
|
||||||
|
NULL = 'null'
|
||||||
|
# empty.append("ByteData--" + (NULL).strip('""'))
|
||||||
|
image_64_encode = image_64_encode.decode('utf-8')
|
||||||
|
empty.append("FileData--" + str(image_64_encode))
|
||||||
|
imagedata = name.split("/")
|
||||||
|
imagename = str(imagedata[-1]).replace('"', '').replace("[", "").replace("]", "")
|
||||||
|
imagename1 = str(imagename).split('.')
|
||||||
|
|
||||||
|
imagename = str(imagename1[-2]).replace("[", "]")
|
||||||
|
empty.append("FileName--" + imagename)
|
||||||
|
empty.append("FilePath--" + name)
|
||||||
|
imageExtension = str(imagename1[-1]).replace("[", "]")
|
||||||
|
empty.append("FileType--" + imageExtension)
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
|
df = pd.DataFrame(empty)
|
||||||
|
df = df[0].str.split("--", expand=True)
|
||||||
|
data1 = pd.DataFrame(df[0])
|
||||||
|
data2 = pd.DataFrame(df[1])
|
||||||
|
dt = data2.set_index(data1[0])
|
||||||
|
|
||||||
|
dt4 = dt.T
|
||||||
|
list = []
|
||||||
|
dictionary = dt4.to_dict(orient="index")
|
||||||
|
|
||||||
|
a = {
|
||||||
|
"FileId": 0,
|
||||||
|
"FileData": "",
|
||||||
|
"FileName": "",
|
||||||
|
"FileType": "",
|
||||||
|
"RefId": 0
|
||||||
|
}
|
||||||
|
list = []
|
||||||
|
|
||||||
|
list.append(a)
|
||||||
|
list.append(dictionary[1])
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
with open('/home/ubuntu/AI/InvoiceParser/firstjson.json', 'r') as json_file:
|
||||||
|
json_load = json.load(json_file)
|
||||||
|
|
||||||
|
# url = "https://test.bizgaze.app:8443/apis/v4/bizgaze/integrations/businesscards/create"
|
||||||
|
|
||||||
|
nothing = json.dumps(json_load).replace("]", "").replace("[", "").replace('{"0":', '').replace('}}', '}')
|
||||||
|
import json
|
||||||
|
|
||||||
|
# JSON data:
|
||||||
|
x = nothing
|
||||||
|
|
||||||
|
# python object to be appended
|
||||||
|
y = {"InvoiceItems":invoice_Item}
|
||||||
|
y1 = {"Document": list}
|
||||||
|
|
||||||
|
# parsing JSON string:
|
||||||
|
z = json.loads(x)
|
||||||
|
|
||||||
|
# appending the data
|
||||||
|
z.update(y)
|
||||||
|
z.update(y1)
|
||||||
|
|
||||||
|
# the result is a JSON string:
|
||||||
|
# print(json.dumps(z))
|
||||||
|
# print('##########################')
|
||||||
|
# print(z)
|
||||||
|
# print('##########################')
|
||||||
|
import requests
|
||||||
|
import json
|
||||||
|
|
||||||
|
# with open('visitingcard1.json', 'r') as json_file:
|
||||||
|
# json_load = json.load(json_file)
|
||||||
|
url = "https://test.bizgaze.app:8443/apis/v4/bizgaze/integrations/invoice/createsalesinvoice"
|
||||||
|
#url="https://test.bizgaze.app:8443/apis/v4/bizgaze/integrations/invoice/createsalesinvoice"
|
||||||
|
payload1 = json.dumps(z)
|
||||||
|
print('--------------------------------------------------------------------------')
|
||||||
|
print(payload1)
|
||||||
|
headers = {
|
||||||
|
'Authorization': 'stat 089166c35d4c4d7d941c99d6f8986834',
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
}
|
||||||
|
response = requests.request("POST", url, headers=headers, data=payload1)
|
||||||
|
print("##############################################################")
|
||||||
|
print(response.text)
|
||||||
|
|
||||||
|
import glob
|
||||||
|
files = glob.glob(
|
||||||
|
"/home/ubuntu/AI/InvoiceParser/upload_invoice/*"
|
||||||
|
)
|
||||||
|
for f in files:
|
||||||
|
os.remove(f)
|
||||||
|
files = glob.glob(
|
||||||
|
"/home/ubuntu/AI/InvoiceParser/uploads/*"
|
||||||
|
)
|
||||||
|
for f in files:
|
||||||
|
os.remove(f)
|
||||||
|
|
||||||
|
return payload1
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/Download_invoice")
|
||||||
|
def Download_invoice():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/Table")
|
||||||
|
def Table():
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/upload_invoice', methods=["POST"])
|
||||||
|
def upload_invoice():
|
||||||
|
if __name__ == "__main__":
|
||||||
|
url_list = []
|
||||||
|
Dataset = request.get_json()
|
||||||
|
# id = "100013660000125"
|
||||||
|
url_list.append(Dataset)
|
||||||
|
# multiprocessing
|
||||||
|
with multiprocessing.Pool(processes=30) as pool:
|
||||||
|
results = pool.map(predict, url_list)
|
||||||
|
|
||||||
|
pool.close()
|
||||||
|
return results[0]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
app.run(host='0.0.0.0', port=9797, debug=True)
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
SELLER NAME,SELLER ADDRESS,SELLER PH,SELLER EMAIL,SELLER GST,SELLER PAN,BUYER NAME,BUYER ADDRESS,BUYER GST,INVOICE NO,INVOICE DATE,SHIP TO,SHIP TO CONTACT,DESTINATION,TOTAL PACKS & QUANTITY,ASSESSABLE AMOUNT,AMOUNT IN WORDS,PAYMENT ON OR BEFORE,OUTPUT SGST,OUTPUT CGST,ROUND OFF,RTS POINTS EARNED,OVERALL RTS POINTS,GRAND TOTAL,OUR BANK DETAILS,BANK A/C NO,RTGS/IFSC
|
||||||
|
Seller : SHREE TRADING CORPORATION,"H- 575A,ROAD NO.6, V.K.I AREA, Jaipur, Rajasthan - 302023",Phone: 9610566688,Email : stc.jaipur@gmail.com,GST No. : 08AAVPM5307P1ZV,PAN No. : AAVPM5307P,Buyer : Stonex India Pvt. Ltd.,"Khasra No. 210, Village - Rahimpura,Makrana Road Kishangarh, 305801",GST No. :08AACCG9620R1ZZ,Invoice No. : JPR21-22/XM01902,Date : 28 Jul 2021,Ship to : ,"Contact: Rajat Ji,9116616323",Destination Kishangarh,Total Quantity 2.00 416.00,Assessable Amount 87360.00,Amount in words : Rupees One Lakh Three Thousand Eighty Five only,Payment on or before Save To pay,Output SGST ,7862.40 Output CGST ,Round off 0.20,,,Grand Total 103085.00,Our Bank Details : Kotak Mahindra Bank,Bank A/c No. : 1412405384,RTGS / IFSC Code : KKBK0003540
|
||||||
|
@@ -0,0 +1,10 @@
|
|||||||
|
Key,Values
|
||||||
|
SI,1
|
||||||
|
HSN,27101980
|
||||||
|
PRODUCT,"MOBILGEAR 600 XP 680, 208LT, DR-"
|
||||||
|
PACK SIZE,1.00
|
||||||
|
QUANTITY,208.00 LTR
|
||||||
|
RATE,240.00
|
||||||
|
DISC,0.000
|
||||||
|
TAX %,9%|9%
|
||||||
|
AMOUNT,49920.00
|
||||||
|
@@ -0,0 +1,10 @@
|
|||||||
|
Key,Implement,Values
|
||||||
|
SI_1,SI,2
|
||||||
|
HSN_1,HSN,27101980
|
||||||
|
PRODUCT_1,PRODUCT,SPARTAN EP 150 DRUM 208L:IN-
|
||||||
|
PACK SIZE_1,PACK SIZE,1.00
|
||||||
|
QUANTITY_1,QUANTITY,208.00 LTR
|
||||||
|
RATE_1,RATE,180.00
|
||||||
|
DISC_1,DISC,0.000
|
||||||
|
TAX %_1,TAX %,9%|9%
|
||||||
|
AMOUNT_1,AMOUNT,37440.00
|
||||||
|
@@ -0,0 +1,10 @@
|
|||||||
|
Key
|
||||||
|
SI
|
||||||
|
HSN
|
||||||
|
PRODUCT
|
||||||
|
PACKSIZE
|
||||||
|
QUANTITY
|
||||||
|
RATE
|
||||||
|
DISC
|
||||||
|
TAX %
|
||||||
|
AMOUNT
|
||||||
|
@@ -0,0 +1,10 @@
|
|||||||
|
Key,Implement
|
||||||
|
SI_1,SI
|
||||||
|
HSN_1,HSN
|
||||||
|
PRODUCT_1,PRODUCT
|
||||||
|
PACK SIZE_1,PACK SIZE
|
||||||
|
QUANTITY_1,QUANTITY
|
||||||
|
RATE_1,RATE
|
||||||
|
DISC_1,DISC
|
||||||
|
TAX %_1,TAX %
|
||||||
|
AMOUNT_1,AMOUNT
|
||||||
|
@@ -0,0 +1,28 @@
|
|||||||
|
Key
|
||||||
|
SELLER NAME
|
||||||
|
SELLER ADDRESS
|
||||||
|
SELLER PH
|
||||||
|
SELLER EMAIL
|
||||||
|
SELLER GST
|
||||||
|
SELLER PAN
|
||||||
|
BUYER NAME
|
||||||
|
BUYER ADDRESS
|
||||||
|
BUYER GST
|
||||||
|
INVOICE NO
|
||||||
|
INVOICE DATE
|
||||||
|
SHIP TO
|
||||||
|
SHIP TO CONTACT
|
||||||
|
DESTINATION
|
||||||
|
TOTAL PACKS & QUANTITY
|
||||||
|
ASSESSABLE AMOUNT
|
||||||
|
AMOUNT IN WORDS
|
||||||
|
PAYMENT ON OR BEFORE
|
||||||
|
OUTPUT SGST
|
||||||
|
OUTPUT CGST
|
||||||
|
ROUND OFF
|
||||||
|
RTS POINTS EARNED
|
||||||
|
OVERALL RTS POINTS
|
||||||
|
GRAND TOTAL
|
||||||
|
OUR BANK DETAILS
|
||||||
|
BANK A/C NO
|
||||||
|
RTGS/IFSC
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
{"lang":"en","name":"model","version":"0.0.0","spacy_version":">=2.2.4","description":"","author":"","email":"","url":"","license":"","vectors":{"width":0,"vectors":0,"keys":0,"name":"spacy_pretrained_vectors"},"pipeline":["ner"],"factories":{"ner":"ner"},"labels":{"ner":["AMOUNT","AMOUNT IN WORDS","ASSESSABLE AMOUNT","BANK A/C NO","BUYER ADDRESS","BUYER GST","BUYER NAME","BUYER PAN","DESTINATION","DISC","DISPATCHED THROUGH","GRAND TOTAL","HSN","INVOICE DATE","INVOICE NO","NARRATION","OUR BANK DETAILS","OUTPUT CGST","OUTPUT SGST","OVERALL RTS POINTS","Output IGST","PACK SIZE","PAYMENT ON OR BEFORE","PAYMENT TYPE","PAYMENT TYPE ","PO NO","PRODUCT","QUANTITY","RATE","ROUND OFF","RTGS/IFSC","RTGS/IFSC ","RTS POINTS EARNED","SELLER ADDRESS","SELLER EMAIL","SELLER GST","SELLER NAME","SELLER PAN","SELLER PH","SHIP TO","SHIP TO ADDRESS","SHIP TO CONTACT","SHIP TO GST","SI","TAX %","TOTAL PACKS & QUANTITY","TOTAL PACKS AND QUANTITY"]}}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"beam_width":1,
|
||||||
|
"beam_density":0.0,
|
||||||
|
"beam_update_prob":1.0,
|
||||||
|
"cnn_maxout_pieces":3,
|
||||||
|
"nr_feature_tokens":6,
|
||||||
|
"nr_class":190,
|
||||||
|
"hidden_depth":1,
|
||||||
|
"token_vector_width":96,
|
||||||
|
"hidden_width":64,
|
||||||
|
"maxout_pieces":2,
|
||||||
|
"pretrained_vectors":null,
|
||||||
|
"bilstm_depth":0,
|
||||||
|
"self_attn_depth":0,
|
||||||
|
"conv_depth":4,
|
||||||
|
"conv_window":1,
|
||||||
|
"embed_size":2000
|
||||||
|
}
|
||||||
İkili dosya gösterilmiyor.
@@ -0,0 +1 @@
|
|||||||
|
�¥movesÚ
|
||||||
Dosya farkları bir veya daha fazla satır çok uzun olduğundan bastırıldı
@@ -0,0 +1 @@
|
|||||||
|
�
|
||||||
İkili dosya gösterilmiyor.
Dosya farkı çok büyük olduğundan ihmal edildi
Fark Yükle
İkili dosya gösterilmiyor.
@@ -0,0 +1,87 @@
|
|||||||
|
asgiref==3.5.0
|
||||||
|
backports.zoneinfo==0.2.1
|
||||||
|
blis==0.7.5
|
||||||
|
camelot-py==0.10.1
|
||||||
|
catalogue==1.0.0
|
||||||
|
certifi==2021.10.8
|
||||||
|
cffi==1.15.0
|
||||||
|
chardet==4.0.0
|
||||||
|
charset-normalizer==2.0.9
|
||||||
|
ci-info==0.2.0
|
||||||
|
click==8.0.3
|
||||||
|
coloredlogs==15.0.1
|
||||||
|
configobj==5.0.6
|
||||||
|
configparser==5.2.0
|
||||||
|
cryptography==36.0.1
|
||||||
|
cycler==0.11.0
|
||||||
|
cymem==2.0.6
|
||||||
|
Django==4.0.3
|
||||||
|
docx==0.2.4
|
||||||
|
docx2txt==0.8
|
||||||
|
et-xmlfile==1.1.0
|
||||||
|
etelemetry==0.2.2
|
||||||
|
filelock==3.4.2
|
||||||
|
fitz==0.0.1.dev2
|
||||||
|
Flask==2.0.2
|
||||||
|
fonttools==4.28.5
|
||||||
|
future==0.18.2
|
||||||
|
ghostscript==0.7
|
||||||
|
httplib2==0.20.2
|
||||||
|
humanfriendly==10.0
|
||||||
|
idna==3.3
|
||||||
|
image==1.5.33
|
||||||
|
img2pdf==0.4.3
|
||||||
|
importlib-resources==5.4.0
|
||||||
|
isodate==0.6.1
|
||||||
|
itsdangerous==2.0.1
|
||||||
|
Jinja2==3.0.3
|
||||||
|
kiwisolver==1.3.2
|
||||||
|
lxml==4.7.1
|
||||||
|
MarkupSafe==2.0.1
|
||||||
|
matplotlib==3.5.1
|
||||||
|
murmurhash==1.0.6
|
||||||
|
networkx==2.6.3
|
||||||
|
nibabel==3.2.1
|
||||||
|
nipype==1.7.0
|
||||||
|
numpy==1.22.0
|
||||||
|
ocrmypdf==13.4.1
|
||||||
|
opencv-python==4.5.5.62
|
||||||
|
openpyxl==3.0.9
|
||||||
|
packaging==21.3
|
||||||
|
pandas==1.3.5
|
||||||
|
pathlib==1.0.1
|
||||||
|
pdfminer.six==20211012
|
||||||
|
pikepdf==5.1.0
|
||||||
|
Pillow==9.0.0
|
||||||
|
plac==1.1.3
|
||||||
|
pluggy==1.0.0
|
||||||
|
preshed==3.0.6
|
||||||
|
prov==2.0.0
|
||||||
|
pycparser==2.21
|
||||||
|
pydot==1.4.2
|
||||||
|
PyMuPDF==1.19.4
|
||||||
|
pyparsing==3.0.6
|
||||||
|
PyPDF2==1.26.0
|
||||||
|
pytesseract==0.3.8
|
||||||
|
python-dateutil==2.8.2
|
||||||
|
python-docx==0.8.11
|
||||||
|
pytz==2021.3
|
||||||
|
pyxnat==1.4
|
||||||
|
rdflib==6.1.1
|
||||||
|
reportlab==3.6.8
|
||||||
|
requests==2.26.0
|
||||||
|
scipy==1.7.3
|
||||||
|
simplejson==3.17.6
|
||||||
|
six==1.16.0
|
||||||
|
spacy==2.3.5
|
||||||
|
sqlparse==0.4.2
|
||||||
|
srsly==1.0.5
|
||||||
|
tabulate==0.8.9
|
||||||
|
thinc==7.4.5
|
||||||
|
tqdm==4.62.3
|
||||||
|
traits==6.3.2
|
||||||
|
urllib3==1.26.7
|
||||||
|
wasabi==0.9.0
|
||||||
|
Werkzeug==2.0.2
|
||||||
|
xlrd==1.2.0
|
||||||
|
zipp==3.7.0
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background-color: #000000; /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height:100%;
|
||||||
|
font-family: 'Helvetica';
|
||||||
|
background-color:#000000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align:center;
|
||||||
|
letter-spacing:1.4px;
|
||||||
|
}
|
||||||
|
.dropbtn {
|
||||||
|
background-color: #04AA6D;
|
||||||
|
color: white;
|
||||||
|
padding: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-content {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
min-width: 160px;
|
||||||
|
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-content a {
|
||||||
|
color: black;
|
||||||
|
padding: 12px 16px;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-content a:hover {background-color: #ddd;}
|
||||||
|
|
||||||
|
.dropdown:hover .dropdown-content {display: block;}
|
||||||
|
|
||||||
|
.dropdown:hover .dropbtn {background-color: #3e8e41;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="background-image: url('https://lh3.googleusercontent.com/p/AF1QipONWF8G50u9Bu-dklcj3kzesofOn8Z0q0LdHeU1=w1080-h608-p-no-v0');
|
||||||
|
/* Full height */
|
||||||
|
height: 100%;
|
||||||
|
/ Center and scale the image nicely /
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br> <br>
|
||||||
|
<a class="button button5"href="/">RETURN HOME</a><br><br><br>
|
||||||
|
|
||||||
|
<h3 class="button button3">Invalid File Input </h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background-color: #000000; /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height:100%;
|
||||||
|
font-family: 'Helvetica';
|
||||||
|
background-color:#000000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align:center;
|
||||||
|
letter-spacing:1.4px;
|
||||||
|
}
|
||||||
|
.dropbtn {
|
||||||
|
background-color: #04AA6D;
|
||||||
|
color: white;
|
||||||
|
padding: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-content {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
min-width: 160px;
|
||||||
|
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-content a {
|
||||||
|
color: black;
|
||||||
|
padding: 12px 16px;
|
||||||
|
text-decoration: none;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-content a:hover {background-color: #ddd;}
|
||||||
|
|
||||||
|
.dropdown:hover .dropdown-content {display: block;}
|
||||||
|
|
||||||
|
.dropdown:hover .dropbtn {background-color: #3e8e41;}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="background-image: url('https://lh3.googleusercontent.com/p/AF1QipONWF8G50u9Bu-dklcj3kzesofOn8Z0q0LdHeU1=w1080-h608-p-no-v0');
|
||||||
|
/* Full height */
|
||||||
|
height: 100%;
|
||||||
|
/ Center and scale the image nicely /
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;">
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<h2 class="button button5">Bizgaze Limited</h2><br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="button button5" >Parser</button>
|
||||||
|
<div class="dropdown-content">
|
||||||
|
<a href="/resume"> RESUME </a>
|
||||||
|
<a href="/invoice"> INVOICE </a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
.button {
|
||||||
|
background-color: #000000; /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div style="background-image: url('https://lh3.googleusercontent.com/p/AF1QipONWF8G50u9Bu-dklcj3kzesofOn8Z0q0LdHeU1=w1080-h608-p-no-v0');
|
||||||
|
/* Full height */
|
||||||
|
height: 100%;
|
||||||
|
/ Center and scale the image nicely /
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;">
|
||||||
|
|
||||||
|
<h1 class="button button5"> INVOICE PARSER </h1>
|
||||||
|
|
||||||
|
<br> <br>
|
||||||
|
<a class="button button5"href="/">HOME</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form action="/upload_invoice" method="POST" enctype="multipart/form-data">
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="custom-file">
|
||||||
|
<input type="file" class="button button5" name="image" id="image" accept=".jpg,.png,.jpeg,.JPEG,.pdf"> <br> <br><br>
|
||||||
|
<div class="bg"></div>
|
||||||
|
<input class="button button5" type="submit">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<form action="{{ url_for('Download_invoice') }}" method="GET">
|
||||||
|
<br><br> <input type="submit" class="button button5" value="Download"></form>
|
||||||
|
<form action="{{ url_for('Table') }}" method="GET">
|
||||||
|
<br><br> <input type="submit" class="button button5" value="Table"></form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height:100%;
|
||||||
|
font-family: 'Helvetica';
|
||||||
|
background-color:#000000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align:center;
|
||||||
|
letter-spacing:1.4px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,82 @@
|
|||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
.button {
|
||||||
|
background-color: #000000; /* Green */
|
||||||
|
border: none;
|
||||||
|
color: white;
|
||||||
|
padding: 15px 32px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
margin: 4px 2px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.button1 {font-size: 10px;}
|
||||||
|
.button2 {font-size: 12px;}
|
||||||
|
.button3 {font-size: 16px;}
|
||||||
|
.button4 {font-size: 50px;}
|
||||||
|
.button5 {font-size: 24px;border-radius: 12px;}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div style="background-image: url('https://lh3.googleusercontent.com/p/AF1QipONWF8G50u9Bu-dklcj3kzesofOn8Z0q0LdHeU1=w1080-h608-p-no-v0');
|
||||||
|
/* Full height */
|
||||||
|
height: 100%;
|
||||||
|
/ Center and scale the image nicely /
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: cover;">
|
||||||
|
|
||||||
|
<h1 class="button button5"> RESUME PARSER </h1>
|
||||||
|
<br> <br>
|
||||||
|
<a class="button button5"href="/">HOME</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<form action="/upload_resume" method="POST" enctype="multipart/form-data">
|
||||||
|
<div class="form-group">
|
||||||
|
|
||||||
|
|
||||||
|
<div class="custom-file">
|
||||||
|
<input type="file" class="button button5" name="image" id="image" accept=".doc,.docx,.pdf"> <br> <br><br>
|
||||||
|
<div class="bg"></div>
|
||||||
|
<input class="button button5" type="submit">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<form action="{{ url_for('Download_resume') }}" method="GET">
|
||||||
|
<br><br> <input type="submit" class="button button5" value="Download"></form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
body {
|
||||||
|
width: 100%;
|
||||||
|
height:100%;
|
||||||
|
font-family: 'Helvetica';
|
||||||
|
background-color:#000000;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 24px;
|
||||||
|
text-align:center;
|
||||||
|
letter-spacing:1.4px;
|
||||||
|
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
İkili dosya gösterilmiyor.
İkili dosya gösterilmiyor.
@@ -0,0 +1,8 @@
|
|||||||
|
Key,Values
|
||||||
|
NAME,M.Amrutha
|
||||||
|
EXPERIENCE,"Professional Experience Project Title #1 INVENTORY MANAGEMENT SYSTEM Work Place Himansu It Services PVT.LTD. Work Location Hyderabad Technologies C#.net,sqlserver-2008 Operating System Microsoft Windows 10 Role Developer Team Size 2 Project Details This window based stock system software used in any kind of shop like any grocery shop, any electrical accessory shop. We can use this software for maintain stock inventory records and sales, order, payment records on daily and monthly basis. The stock management software generate stock reports, sales reports, payment reports all types of reports which are necessary for mange our stock will generate in this system. We also provide facilities to order cancellation, returns faulty stock to company or dealer, maintain stock company bill and company payment detail. Maintain stock record like stock, sell record, order record and maintain inventory on daily and monthly basis. Responsibility Development Coding and Design. Project Title #2 Sales Invoice Work Place Himansu It Services PVT.LTD Work Location Hyderabad Technologies Windows Application C#,NET,Postgresql Operating System Microsoft Windows 8 Role Developer Team Size 2 Project Details This is a windows Forms Application the user wiil create Crystal Reports create sales invoice/receipt using crystal report in c# windows application with the stored procedure..In order to implement daily reports as sales reports, and stock reports in c# windows application”. Responsibility Development Coding and Design. Generate Crystal Reports"
|
||||||
|
EMAIL,ammu.raby@gmail.com
|
||||||
|
MOBILE NUMBER,Contact:9110317873
|
||||||
|
EXPERIENCE,"Professional Experience Project Title #1 INVENTORY MANAGEMENT SYSTEM Work Place Himansu It Services PVT.LTD. Work Location Hyderabad Technologies C#.net,sqlserver-2008 Operating System Microsoft Windows 10 Role Developer Team Size 2 Project Details This window based stock system software used in any kind of shop like any grocery shop, any electrical accessory shop. We can use this software for maintain stock inventory records and sales, order, payment records on daily and monthly basis. The stock management software generate stock reports, sales reports, payment reports all types of reports which are necessary for mange our stock will generate in this system. We also provide facilities to order cancellation, returns faulty stock to company or dealer, maintain stock company bill and company payment detail. Maintain stock record like stock, sell record, order record and maintain inventory on daily and monthly basis. Responsibility Development Coding and Design. Project Title #2 Sales Invoice Work Place Himansu It Services PVT.LTD Work Location Hyderabad Technologies Windows Application C#,NET,Postgresql Operating System Microsoft Windows 8 Role Developer Team Size 2 Project Details This is a windows Forms Application the user wiil create Crystal Reports create sales invoice/receipt using crystal report in c# windows application with the stored procedure..In order to implement daily reports as sales reports, and stock reports in c# windows application”. Responsibility Development Coding and Design. Generate Crystal Reports"
|
||||||
|
SKILLS,"Technical Skills Microsoft Technologies : ASP.NET, C#.NET, ADO.NET, MVC 4.0. Languages : C-sharp. Scripting Languages :Java Script, Jquery Database : SQL Server 2008, 2012. IDE : VisualStudio.NET 2010, 2012, 2013."
|
||||||
|
SOCIAL NETWORKS,
|
||||||
|
@@ -0,0 +1,9 @@
|
|||||||
|
Key
|
||||||
|
NAME
|
||||||
|
EXPERIENCE
|
||||||
|
EMAIL
|
||||||
|
MOBILE NUMBER
|
||||||
|
EXPERIENCE
|
||||||
|
SKILLS
|
||||||
|
SOCIAL NETWORKS
|
||||||
|
|
||||||
|
@@ -0,0 +1,16 @@
|
|||||||
|
Key,Values
|
||||||
|
NAME,M.Amrutha
|
||||||
|
MOBILE NUMBER,Contact:9110317873
|
||||||
|
EMAIL,ammu.raby@gmail.com
|
||||||
|
SUMMARY,"Professional Summary Currently working as a Software Engineer in Himansu It Services PVT.LTD. Worked as Assistant professor in Ellenki group of Technology (Hyderabad)for 2 years(2015-2017) Over 1+ years of IT experience in various stages of Software Product Development involving Design, Support as well as customization, enhancements, modifications and corrections in existing software to meet client’s requirement. Experienced in development of Web based applications using Asp.Net, C #, JavaScript and SQL Server."
|
||||||
|
SKILLS,"Technical Skills Microsoft Technologies : ASP.NET, C#.NET, ADO.NET, MVC 4.0. Languages : C-sharp. Scripting Languages :Java Script, Jquery Database : SQL Server 2008, 2012. IDE : VisualStudio.NET 2010, 2012, 2013."
|
||||||
|
EXPERIENCE,"Professional Experience Project Title #1 INVENTORY MANAGEMENT SYSTEM Work Place Himansu It Services PVT.LTD. Work Location Hyderabad Technologies C#.net,sqlserver-2008 Operating System Microsoft Windows 10 Role Developer Team Size 2 Project Details This window based stock system software used in any kind of shop like any grocery shop, any electrical accessory shop. We can use this software for maintain stock inventory records and sales, order, payment records on daily and monthly basis. The stock management software generate stock reports, sales reports, payment reports all types of reports which are necessary for mange our stock will generate in this system. We also provide facilities to order cancellation, returns faulty stock to company or dealer, maintain stock company bill and company payment detail. Maintain stock record like stock, sell record, order record and maintain inventory on daily and monthly basis. Responsibility Development Coding and Design. Project Title #2 Sales Invoice Work Place Himansu It Services PVT.LTD Work Location Hyderabad Technologies Windows Application C#,NET,Postgresql Operating System Microsoft Windows 8 Role Developer Team Size 2 Project Details This is a windows Forms Application the user wiil create Crystal Reports create sales invoice/receipt using crystal report in c# windows application with the stored procedure..In order to implement daily reports as sales reports, and stock reports in c# windows application”. Responsibility Development Coding and Design. Generate Crystal Reports"
|
||||||
|
EDUCATION,M.Tech in Software Engineering
|
||||||
|
NAME OF INSTITUTE,"TRR Engineering College,"
|
||||||
|
YEAR OF PASSING,2014
|
||||||
|
UNIVERSITY/BOARD NAME,JNTUH
|
||||||
|
SCORE,80%
|
||||||
|
EDUCATION,B.Tech in Information Technology
|
||||||
|
NAME OF INSTITUTE,Narayana Engineering College
|
||||||
|
YEAR OF PASSING,2007
|
||||||
|
UNIVERSITY/BOARD NAME,JNTUH
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
Key,Values
|
||||||
|
PG,M.Tech in Software Engineering
|
||||||
|
PG_NAME_OF_INSTITUTE,TRR
|
||||||
|
UG_YEAR_OF_PASSING,2014
|
||||||
|
UG,B.Tech in Information Technology
|
||||||
|
UG_NAME_OF_INSTITUTE,"Narayana Engineering College ,Gudur in"
|
||||||
|
INTERMEDIATE_YEAR_OF_PASSING,2007
|
||||||
|
@@ -0,0 +1 @@
|
|||||||
|
{"lang":"en","name":"model","version":"0.0.0","spacy_version":">=2.2.4","description":"","author":"","email":"","url":"","license":"","vectors":{"width":0,"vectors":0,"keys":0,"name":"spacy_pretrained_vectors"},"pipeline":["ner"],"factories":{"ner":"ner"},"labels":{"ner":["Achievements","Address","Certifications","Class","Company","Date of Birth","Designation","Duration","Education","Email","Experience","Gender","Hobbies","Languages Known","Mobile Number","Name","Name of Institute","Score","Skills","Social networks","Summary","University/Board Name","Year of Passing"]}}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"beam_width":1,
|
||||||
|
"beam_density":0.0,
|
||||||
|
"beam_update_prob":1.0,
|
||||||
|
"cnn_maxout_pieces":3,
|
||||||
|
"nr_feature_tokens":6,
|
||||||
|
"nr_class":94,
|
||||||
|
"hidden_depth":1,
|
||||||
|
"token_vector_width":96,
|
||||||
|
"hidden_width":64,
|
||||||
|
"maxout_pieces":2,
|
||||||
|
"pretrained_vectors":null,
|
||||||
|
"bilstm_depth":0,
|
||||||
|
"self_attn_depth":0,
|
||||||
|
"conv_depth":4,
|
||||||
|
"conv_window":1,
|
||||||
|
"embed_size":2000
|
||||||
|
}
|
||||||
İkili dosya gösterilmiyor.
@@ -0,0 +1 @@
|
|||||||
|
�¥movesÚ0{"0":{},"1":{"Name":-1,"Email":-2,"Mobile Number":-3,"Experience":-4,"Designation":-5,"Education":-6,"Name of Institute":-7,"University/Board Name":-8,"Score":-9,"Year of Passing":-10,"Class":-11,"Skills":-12,"Gender":-13,"Duration":-14,"Summary":-15,"Social networks":-16,"Date of Birth":-17,"Address":-18,"Achievements":-19,"Languages Known":-20,"Hobbies":-21,"Company":-22,"Certifications":-23},"2":{"Name":-1,"Email":-2,"Mobile Number":-3,"Experience":-4,"Designation":-5,"Education":-6,"Name of Institute":-7,"University/Board Name":-8,"Score":-9,"Year of Passing":-10,"Class":-11,"Skills":-12,"Gender":-13,"Duration":-14,"Summary":-15,"Social networks":-16,"Date of Birth":-17,"Address":-18,"Achievements":-19,"Languages Known":-20,"Hobbies":-21,"Company":-22,"Certifications":-23},"3":{"Name":-1,"Email":-2,"Mobile Number":-3,"Experience":-4,"Designation":-5,"Education":-6,"Name of Institute":-7,"University/Board Name":-8,"Score":-9,"Year of Passing":-10,"Class":-11,"Skills":-12,"Gender":-13,"Duration":-14,"Summary":-15,"Social networks":-16,"Date of Birth":-17,"Address":-18,"Achievements":-19,"Languages Known":-20,"Hobbies":-21,"Company":-22,"Certifications":-23},"4":{"":1,"Name":-1,"Email":-2,"Mobile Number":-3,"Experience":-4,"Designation":-5,"Education":-6,"Name of Institute":-7,"University/Board Name":-8,"Score":-9,"Year of Passing":-10,"Class":-11,"Skills":-12,"Gender":-13,"Duration":-14,"Summary":-15,"Social networks":-16,"Date of Birth":-17,"Address":-18,"Achievements":-19,"Languages Known":-20,"Hobbies":-21,"Company":-22,"Certifications":-23},"5":{"":1}}
|
||||||
Dosya farkları bir veya daha fazla satır çok uzun olduğundan bastırıldı
@@ -0,0 +1 @@
|
|||||||
|
�
|
||||||
İkili dosya gösterilmiyor.
Dosya farkı çok büyük olduğundan ihmal edildi
Fark Yükle
İkili dosya gösterilmiyor.
@@ -0,0 +1,4 @@
|
|||||||
|
Key,implement
|
||||||
|
PG,QUALIFICATION
|
||||||
|
PG_NAME_OF_INSTITUTE,NAMEOFINSTITUTE
|
||||||
|
PG_YEAR_OF_PASSING,YEAROFPASSING
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
Key,implement,Values
|
||||||
|
PG,QUALIFICATION,M.Tech in Software Engineering
|
||||||
|
PG_NAME_OF_INSTITUTE,NAMEOFINSTITUTE,TRR
|
||||||
|
PG_YEAR_OF_PASSING,YEAROFPASSING,
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
Key,implement
|
||||||
|
SSC,QUALIFICATION
|
||||||
|
SSC_NAME_OF_INSTITUTE,NAMEOFINSTITUTE
|
||||||
|
SSC_YEAR_OF_PASSING,YEAROFPASSING
|
||||||
|
SSC_SCORE,SCORE
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
Key,implement
|
||||||
|
UG,QUALIFACTION
|
||||||
|
UG_NAME_OF_INSTITUTE,NAMEOFINSTITUTE
|
||||||
|
UG_YEAR_OF_PASSING,YEAROFPASSING
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
Key,implement,Values
|
||||||
|
UG,QUALIFACTION,B.Tech in Information Technology
|
||||||
|
UG_NAME_OF_INSTITUTE,NAMEOFINSTITUTE,"Narayana Engineering College ,Gudur in"
|
||||||
|
UG_YEAR_OF_PASSING,YEAROFPASSING,2014
|
||||||
|
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"lang":"en",
|
||||||
|
"name":"model",
|
||||||
|
"version":"0.0.0",
|
||||||
|
"spacy_version":">=2.3.5",
|
||||||
|
"description":"",
|
||||||
|
"author":"",
|
||||||
|
"email":"",
|
||||||
|
"url":"",
|
||||||
|
"license":"",
|
||||||
|
"spacy_git_version":"1d4b1dea2",
|
||||||
|
"vectors":{
|
||||||
|
"width":0,
|
||||||
|
"vectors":0,
|
||||||
|
"keys":0,
|
||||||
|
"name":"spacy_pretrained_vectors"
|
||||||
|
},
|
||||||
|
"pipeline":[
|
||||||
|
"ner"
|
||||||
|
],
|
||||||
|
"factories":{
|
||||||
|
"ner":"ner"
|
||||||
|
},
|
||||||
|
"labels":{
|
||||||
|
"ner":[
|
||||||
|
"INTERMEDIATE",
|
||||||
|
"INTERMEDIATE_Name_of_Institute",
|
||||||
|
"INTERMEDIATE_Score",
|
||||||
|
"INTERMEDIATE_Year_of_Passing",
|
||||||
|
"PG",
|
||||||
|
"PG_Name_of_Institute",
|
||||||
|
"PG_Year_of_Passing",
|
||||||
|
"SSC",
|
||||||
|
"SSC_Name_of_Institute",
|
||||||
|
"SSC_Score",
|
||||||
|
"SSC_Year_of_Passing",
|
||||||
|
"UG",
|
||||||
|
"UG_Name_of_Institute",
|
||||||
|
"UG_Score",
|
||||||
|
"UG_Year_of_Passing"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"beam_width":1,
|
||||||
|
"beam_density":0.0,
|
||||||
|
"beam_update_prob":1.0,
|
||||||
|
"cnn_maxout_pieces":3,
|
||||||
|
"nr_feature_tokens":6,
|
||||||
|
"nr_class":62,
|
||||||
|
"hidden_depth":1,
|
||||||
|
"token_vector_width":96,
|
||||||
|
"hidden_width":64,
|
||||||
|
"maxout_pieces":2,
|
||||||
|
"pretrained_vectors":null,
|
||||||
|
"bilstm_depth":0,
|
||||||
|
"self_attn_depth":0,
|
||||||
|
"conv_depth":4,
|
||||||
|
"conv_window":1,
|
||||||
|
"embed_size":2000
|
||||||
|
}
|
||||||
İkili dosya gösterilmiyor.
@@ -0,0 +1 @@
|
|||||||
|
�¥movesÚ@{"0":{},"1":{"PG":-1,"PG_Name_of_Institute":-2,"PG_Year_of_Passing":-3,"UG":-4,"UG_Name_of_Institute":-5,"UG_Year_of_Passing":-6,"UG_Score":-7,"INTERMEDIATE":-8,"INTERMEDIATE_Score":-9,"INTERMEDIATE_Name_of_Institute":-10,"INTERMEDIATE_Year_of_Passing":-11,"SSC":-12,"SSC_Score":-13,"SSC_Name_of_Institute":-14,"SSC_Year_of_Passing":-15},"2":{"PG":-1,"PG_Name_of_Institute":-2,"PG_Year_of_Passing":-3,"UG":-4,"UG_Name_of_Institute":-5,"UG_Year_of_Passing":-6,"UG_Score":-7,"INTERMEDIATE":-8,"INTERMEDIATE_Score":-9,"INTERMEDIATE_Name_of_Institute":-10,"INTERMEDIATE_Year_of_Passing":-11,"SSC":-12,"SSC_Score":-13,"SSC_Name_of_Institute":-14,"SSC_Year_of_Passing":-15},"3":{"PG":-1,"PG_Name_of_Institute":-2,"PG_Year_of_Passing":-3,"UG":-4,"UG_Name_of_Institute":-5,"UG_Year_of_Passing":-6,"UG_Score":-7,"INTERMEDIATE":-8,"INTERMEDIATE_Score":-9,"INTERMEDIATE_Name_of_Institute":-10,"INTERMEDIATE_Year_of_Passing":-11,"SSC":-12,"SSC_Score":-13,"SSC_Name_of_Institute":-14,"SSC_Year_of_Passing":-15},"4":{"":1,"PG":-1,"PG_Name_of_Institute":-2,"PG_Year_of_Passing":-3,"UG":-4,"UG_Name_of_Institute":-5,"UG_Year_of_Passing":-6,"UG_Score":-7,"INTERMEDIATE":-8,"INTERMEDIATE_Score":-9,"INTERMEDIATE_Name_of_Institute":-10,"INTERMEDIATE_Year_of_Passing":-11,"SSC":-12,"SSC_Score":-13,"SSC_Name_of_Institute":-14,"SSC_Year_of_Passing":-15},"5":{"":1}}
|
||||||
Dosya farkları bir veya daha fazla satır çok uzun olduğundan bastırıldı
Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor Daha Fazla Göster
Yeni konuda referans
Bir kullanıcı engelle