suvadityamuk commited on
Commit
fc1f1b8
1 Parent(s): 2b5a403

added dataset and made corrections

Browse files

Signed-off-by: Suvaditya Mukherjee <suvadityamuk@gmail.com>

This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +1 -0
  2. app.py +11 -10
  3. celeb_dataset/Angelina Jolie/001_fe3347c0.jpg +3 -0
  4. celeb_dataset/Angelina Jolie/002_8f8da10e.jpg +3 -0
  5. celeb_dataset/Angelina Jolie/003_57612506.jpg +3 -0
  6. celeb_dataset/Angelina Jolie/004_f61e7d0c.jpg +3 -0
  7. celeb_dataset/Angelina Jolie/005_582c121a.jpg +3 -0
  8. celeb_dataset/Brad Pitt/001_c04300ef.jpg +3 -0
  9. celeb_dataset/Brad Pitt/002_cc1b9701.jpg +3 -0
  10. celeb_dataset/Brad Pitt/003_7a6b2156.jpg +3 -0
  11. celeb_dataset/Brad Pitt/004_777c50d0.jpg +3 -0
  12. celeb_dataset/Brad Pitt/005_02ab3a1b.jpg +3 -0
  13. celeb_dataset/Denzel Washington/001_d3323f3c.jpg +3 -0
  14. celeb_dataset/Denzel Washington/002_f44b8d45.jpg +3 -0
  15. celeb_dataset/Denzel Washington/003_b622e925.jpg +3 -0
  16. celeb_dataset/Denzel Washington/004_677c65bf.jpg +3 -0
  17. celeb_dataset/Denzel Washington/005_cb37c7b2.jpg +3 -0
  18. celeb_dataset/Hugh Jackman/001_9adc92c2.jpg +3 -0
  19. celeb_dataset/Hugh Jackman/002_85eab275.jpg +3 -0
  20. celeb_dataset/Hugh Jackman/003_8889ec2c.jpg +3 -0
  21. celeb_dataset/Hugh Jackman/004_41caa173.jpg +3 -0
  22. celeb_dataset/Hugh Jackman/005_3ba56da0.jpg +3 -0
  23. celeb_dataset/Jennifer Lawrence/001_21a7d5e6.jpg +3 -0
  24. celeb_dataset/Jennifer Lawrence/002_533748b2.jpg +3 -0
  25. celeb_dataset/Jennifer Lawrence/003_963a3627.jpg +3 -0
  26. celeb_dataset/Jennifer Lawrence/004_94f26ed9.jpg +3 -0
  27. celeb_dataset/Jennifer Lawrence/005_7f198c47.jpg +3 -0
  28. celeb_dataset/Johnny Depp/001_2288a4f6.jpg +3 -0
  29. celeb_dataset/Johnny Depp/002_331d0423.jpg +3 -0
  30. celeb_dataset/Johnny Depp/003_64926b97.jpg +3 -0
  31. celeb_dataset/Johnny Depp/004_18e08ab4.jpg +3 -0
  32. celeb_dataset/Johnny Depp/005_9406f32d.jpg +3 -0
  33. celeb_dataset/Kate Winslet/001_5992faf7.jpg +3 -0
  34. celeb_dataset/Kate Winslet/002_590bb980.jpg +3 -0
  35. celeb_dataset/Kate Winslet/003_acb20793.jpg +3 -0
  36. celeb_dataset/Kate Winslet/004_0816d969.jpg +3 -0
  37. celeb_dataset/Kate Winslet/005_93b2fce9.jpg +3 -0
  38. celeb_dataset/Leonardo DiCaprio/001_08194468.jpg +3 -0
  39. celeb_dataset/Leonardo DiCaprio/002_86e8aa58.jpg +3 -0
  40. celeb_dataset/Leonardo DiCaprio/003_85990366.jpg +3 -0
  41. celeb_dataset/Leonardo DiCaprio/004_af012af1.jpg +3 -0
  42. celeb_dataset/Leonardo DiCaprio/005_7fe5b764.jpg +3 -0
  43. celeb_dataset/Megan Fox/001_dfb62d96.jpg +3 -0
  44. celeb_dataset/Megan Fox/002_6e289116.jpg +3 -0
  45. celeb_dataset/Megan Fox/003_61dd1e53.jpg +3 -0
  46. celeb_dataset/Megan Fox/004_6aede3d3.jpg +3 -0
  47. celeb_dataset/Megan Fox/005_9574c208.jpg +3 -0
  48. celeb_dataset/Natalie Portman/001_9cd1160a.jpg +3 -0
  49. celeb_dataset/Natalie Portman/002_3a2ef5df.jpg +3 -0
  50. celeb_dataset/Natalie Portman/003_13b7bb9d.jpg +3 -0
.gitattributes CHANGED
@@ -37,3 +37,4 @@ openface.nn4.small2.v1.t7 filter=lfs diff=lfs merge=lfs -text
37
  res10_300x300_ssd_iter_140000.caffemodel filter=lfs diff=lfs merge=lfs -text
38
  unknownEmbeddings.pkl filter=lfs diff=lfs merge=lfs -text
39
  unknownNames.pkl filter=lfs diff=lfs merge=lfs -text
 
 
37
  res10_300x300_ssd_iter_140000.caffemodel filter=lfs diff=lfs merge=lfs -text
38
  unknownEmbeddings.pkl filter=lfs diff=lfs merge=lfs -text
39
  unknownNames.pkl filter=lfs diff=lfs merge=lfs -text
40
+ celeb_dataset/** filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -13,15 +13,17 @@ from imutils import resize
13
 
14
  def calc_embeddings(all_files, names):
15
  detector = cv2.dnn.readNetFromCaffe(
16
- "deploy.prototxt.txt", "res10_300x300_ssd_iter_140000.caffemodel"
17
  )
18
- embedder = cv2.dnn.readNetFromTorch("openface.nn4.small2.v1.t7")
19
  knownNames = []
20
  knownEmbeddings = []
21
  total = 0
22
  for file in all_files:
23
  name = names[total]
24
- f = open(f"/content/Celebrity Faces Dataset/{name}/{file}", "rb")
 
 
25
  file_bytes = np.asarray(bytearray(f.read()), dtype=np.uint8)
26
  image = cv2.imdecode(file_bytes, 1)
27
  image = resize(image, width=600)
@@ -58,9 +60,9 @@ def calc_embeddings(all_files, names):
58
  knownNames.append(name)
59
  knownEmbeddings.append(vec.flatten())
60
  total += 1
61
- with open("/content/unknownEmbeddings.pkl", "rb") as fp:
62
  l = pickle.load(fp)
63
- with open("/content/unknownNames.pkl", "rb") as fp:
64
  n = pickle.load(fp)
65
  for i in l:
66
  knownEmbeddings.append(i)
@@ -80,7 +82,7 @@ def recognize(embeddings, names):
80
 
81
  def run_inference(myImage):
82
 
83
- os.chdir("/content/Celebrity Faces Dataset")
84
  celebs = []
85
  scores = dict()
86
 
@@ -96,12 +98,11 @@ def run_inference(myImage):
96
  names.append(name)
97
  embeddings, names = calc_embeddings(files, names)
98
  le, model = recognize(embeddings, names)
99
-
100
  detector = cv2.dnn.readNetFromCaffe(
101
- "/content/deploy.prototxt.txt",
102
- "/content/res10_300x300_ssd_iter_140000.caffemodel",
103
  )
104
- embedder = cv2.dnn.readNetFromTorch("/content/openface.nn4.small2.v1.t7")
105
  (h, w) = myImage.shape[:2]
106
  imageBlob = cv2.dnn.blobFromImage(
107
  cv2.resize(myImage, (300, 300)),
 
13
 
14
  def calc_embeddings(all_files, names):
15
  detector = cv2.dnn.readNetFromCaffe(
16
+ "../deploy.prototxt.txt", "../res10_300x300_ssd_iter_140000.caffemodel"
17
  )
18
+ embedder = cv2.dnn.readNetFromTorch("../openface.nn4.small2.v1.t7")
19
  knownNames = []
20
  knownEmbeddings = []
21
  total = 0
22
  for file in all_files:
23
  name = names[total]
24
+ path = os.path.join(os.getcwd(), name, file)
25
+ # f = open(f"/celeb_dataset/'{name}'/{file}", "rb")
26
+ f = open(path, "rb")
27
  file_bytes = np.asarray(bytearray(f.read()), dtype=np.uint8)
28
  image = cv2.imdecode(file_bytes, 1)
29
  image = resize(image, width=600)
 
60
  knownNames.append(name)
61
  knownEmbeddings.append(vec.flatten())
62
  total += 1
63
+ with open("../unknownEmbeddings.pkl", "rb") as fp:
64
  l = pickle.load(fp)
65
+ with open("../unknownNames.pkl", "rb") as fp:
66
  n = pickle.load(fp)
67
  for i in l:
68
  knownEmbeddings.append(i)
 
82
 
83
  def run_inference(myImage):
84
 
85
+ os.chdir("celeb_dataset")
86
  celebs = []
87
  scores = dict()
88
 
 
98
  names.append(name)
99
  embeddings, names = calc_embeddings(files, names)
100
  le, model = recognize(embeddings, names)
 
101
  detector = cv2.dnn.readNetFromCaffe(
102
+ "../deploy.prototxt.txt",
103
+ "../res10_300x300_ssd_iter_140000.caffemodel",
104
  )
105
+ embedder = cv2.dnn.readNetFromTorch("../openface.nn4.small2.v1.t7")
106
  (h, w) = myImage.shape[:2]
107
  imageBlob = cv2.dnn.blobFromImage(
108
  cv2.resize(myImage, (300, 300)),
celeb_dataset/Angelina Jolie/001_fe3347c0.jpg ADDED

Git LFS Details

  • SHA256: 678fe0adb4a2acbfaf28595bb941e946276ac4e73626ceddaa92b673642c7793
  • Pointer size: 130 Bytes
  • Size of remote file: 36 kB
celeb_dataset/Angelina Jolie/002_8f8da10e.jpg ADDED

Git LFS Details

  • SHA256: 983dc338eebabac9b61221857f1adab5592acee2e9aaf9a40be834962138932c
  • Pointer size: 130 Bytes
  • Size of remote file: 38.8 kB
celeb_dataset/Angelina Jolie/003_57612506.jpg ADDED

Git LFS Details

  • SHA256: 093f80f7593746a405d2c73826eef20638cd8e2e3fe0d6481252384833bf7308
  • Pointer size: 130 Bytes
  • Size of remote file: 33.8 kB
celeb_dataset/Angelina Jolie/004_f61e7d0c.jpg ADDED

Git LFS Details

  • SHA256: 9f7a913ddc416c46faff2c251e77ad1d792ab8677b31bcef73cbfd7acf810448
  • Pointer size: 129 Bytes
  • Size of remote file: 5.68 kB
celeb_dataset/Angelina Jolie/005_582c121a.jpg ADDED

Git LFS Details

  • SHA256: 926a8895f8574c1678ad06bdf07d07d2c7352a6135772398ae58106ef807af7a
  • Pointer size: 130 Bytes
  • Size of remote file: 35.7 kB
celeb_dataset/Brad Pitt/001_c04300ef.jpg ADDED

Git LFS Details

  • SHA256: cff8a3f5bc2fb69516379fee833bb993c776e82af05eea2666a532b898ecd0f2
  • Pointer size: 130 Bytes
  • Size of remote file: 36.7 kB
celeb_dataset/Brad Pitt/002_cc1b9701.jpg ADDED

Git LFS Details

  • SHA256: a9a893e19ae6657dc8765944649ca76dacf0d0e9ad56043ef7012c8936cf5190
  • Pointer size: 130 Bytes
  • Size of remote file: 37.5 kB
celeb_dataset/Brad Pitt/003_7a6b2156.jpg ADDED

Git LFS Details

  • SHA256: 074688cd7df0d97255213c1e1d859b87ba5969b2d0fb06022fd6dfaaba799a20
  • Pointer size: 130 Bytes
  • Size of remote file: 22 kB
celeb_dataset/Brad Pitt/004_777c50d0.jpg ADDED

Git LFS Details

  • SHA256: 39b7e19a1bba7fd0c72a1f3783dcc553c472271fe0608c759d494efac5c77a13
  • Pointer size: 130 Bytes
  • Size of remote file: 30.1 kB
celeb_dataset/Brad Pitt/005_02ab3a1b.jpg ADDED

Git LFS Details

  • SHA256: b493e00d2e1e9a1470c8cba9e31b07c3586846f9572b7729f0c63fff1007ffea
  • Pointer size: 130 Bytes
  • Size of remote file: 20.8 kB
celeb_dataset/Denzel Washington/001_d3323f3c.jpg ADDED

Git LFS Details

  • SHA256: 61b9eb3dd54dcf7351d8d445f1b311fc62cbddfa9424502f4bb912287096ec63
  • Pointer size: 130 Bytes
  • Size of remote file: 29.8 kB
celeb_dataset/Denzel Washington/002_f44b8d45.jpg ADDED

Git LFS Details

  • SHA256: 95eeae8b00aad230736fba3241546faf71973f3d7efc139203032441f2a50c11
  • Pointer size: 130 Bytes
  • Size of remote file: 21 kB
celeb_dataset/Denzel Washington/003_b622e925.jpg ADDED

Git LFS Details

  • SHA256: 62bed2e79c9e489de4f83da7ecff44bcad8cdc27c93cc025072797b4c4317103
  • Pointer size: 130 Bytes
  • Size of remote file: 32.6 kB
celeb_dataset/Denzel Washington/004_677c65bf.jpg ADDED

Git LFS Details

  • SHA256: 034af7fe29e60bb009dc6b1136670938d94b6a9e496ffec63153728a2c3e9777
  • Pointer size: 130 Bytes
  • Size of remote file: 20.7 kB
celeb_dataset/Denzel Washington/005_cb37c7b2.jpg ADDED

Git LFS Details

  • SHA256: 22fcfffa5508d8411e02c8cc9fb327acb49845b60f8e70039d22e59d74b3cb42
  • Pointer size: 130 Bytes
  • Size of remote file: 18.5 kB
celeb_dataset/Hugh Jackman/001_9adc92c2.jpg ADDED

Git LFS Details

  • SHA256: fe3a4e76e87e727f45632cda4945b923fe492619c3e1e05c2144aab9010d65b5
  • Pointer size: 130 Bytes
  • Size of remote file: 33.8 kB
celeb_dataset/Hugh Jackman/002_85eab275.jpg ADDED

Git LFS Details

  • SHA256: c2288fd32a35d2859154c284b29474ed76e85344915d56c433d4d57a957395df
  • Pointer size: 130 Bytes
  • Size of remote file: 29.1 kB
celeb_dataset/Hugh Jackman/003_8889ec2c.jpg ADDED

Git LFS Details

  • SHA256: f4f0fe935047d1ea300eb0e0842b02eb67f946a7fc17438f7fdd1fcad930c94a
  • Pointer size: 130 Bytes
  • Size of remote file: 28.5 kB
celeb_dataset/Hugh Jackman/004_41caa173.jpg ADDED

Git LFS Details

  • SHA256: d7b2a001802c8c024d90e366d0215d523d6c04c23e99e793f8683c6f715f1005
  • Pointer size: 130 Bytes
  • Size of remote file: 24.9 kB
celeb_dataset/Hugh Jackman/005_3ba56da0.jpg ADDED

Git LFS Details

  • SHA256: 9fbcdc242bfa700a65bdf12f52840739b61bac58ae8b7448583a1f6bb5369229
  • Pointer size: 130 Bytes
  • Size of remote file: 29.7 kB
celeb_dataset/Jennifer Lawrence/001_21a7d5e6.jpg ADDED

Git LFS Details

  • SHA256: b4ca7608b6a5ac9546b19473b8920647ebe78f398ca4405eb090f6ff9a69f3d2
  • Pointer size: 130 Bytes
  • Size of remote file: 33.7 kB
celeb_dataset/Jennifer Lawrence/002_533748b2.jpg ADDED

Git LFS Details

  • SHA256: bd82d35740fddc71a263b5e2aad03bda9608c67c13ac1ec286d3c4979f001b3d
  • Pointer size: 130 Bytes
  • Size of remote file: 26.9 kB
celeb_dataset/Jennifer Lawrence/003_963a3627.jpg ADDED

Git LFS Details

  • SHA256: be7e1b192e1cc90257ecd188ebdc72e50940cb920025cd47ee0fd0f4e19917ac
  • Pointer size: 130 Bytes
  • Size of remote file: 66.6 kB
celeb_dataset/Jennifer Lawrence/004_94f26ed9.jpg ADDED

Git LFS Details

  • SHA256: 446f2ebaae64a1b2150739cc24b6947d71606aa78d960f6777c6e347ded519b0
  • Pointer size: 130 Bytes
  • Size of remote file: 49.9 kB
celeb_dataset/Jennifer Lawrence/005_7f198c47.jpg ADDED

Git LFS Details

  • SHA256: 9ba7d09b9f4e810766a073b9d01b0c85b5d127bafbae1c2ac178a5d37aa253e6
  • Pointer size: 130 Bytes
  • Size of remote file: 39.4 kB
celeb_dataset/Johnny Depp/001_2288a4f6.jpg ADDED

Git LFS Details

  • SHA256: ee1ec45df848fae88021e052d00f880711b711e61e281c9fbf131e2c11989d29
  • Pointer size: 130 Bytes
  • Size of remote file: 24.9 kB
celeb_dataset/Johnny Depp/002_331d0423.jpg ADDED

Git LFS Details

  • SHA256: ab646de8ef1abcd6b19097827db9a89b58830cc66593771c0a661a9bd31662f1
  • Pointer size: 130 Bytes
  • Size of remote file: 34.2 kB
celeb_dataset/Johnny Depp/003_64926b97.jpg ADDED

Git LFS Details

  • SHA256: 74a8c42ea60f1f0d11d8f42fed2890d37c8f2d4b8b0297ef3769a3f9bbef66b4
  • Pointer size: 129 Bytes
  • Size of remote file: 5.08 kB
celeb_dataset/Johnny Depp/004_18e08ab4.jpg ADDED

Git LFS Details

  • SHA256: 6f39915174099e1e712260abefbb69d6637642e524db83e16a64273fa0756d8e
  • Pointer size: 130 Bytes
  • Size of remote file: 33.5 kB
celeb_dataset/Johnny Depp/005_9406f32d.jpg ADDED

Git LFS Details

  • SHA256: d9bf03329584737409859f6e8cad2e3fa048bb334d8fadd3f72ca6f5d94b72c7
  • Pointer size: 130 Bytes
  • Size of remote file: 36.5 kB
celeb_dataset/Kate Winslet/001_5992faf7.jpg ADDED

Git LFS Details

  • SHA256: 053e3005df3472243a1f593c49aaa3951dd7374ede913acff2b3a2a556fdc214
  • Pointer size: 130 Bytes
  • Size of remote file: 35.8 kB
celeb_dataset/Kate Winslet/002_590bb980.jpg ADDED

Git LFS Details

  • SHA256: 1347b65d4268b9996f9b91efa629934c6def13ee5ac5c8c885a78cd20828553a
  • Pointer size: 130 Bytes
  • Size of remote file: 26.7 kB
celeb_dataset/Kate Winslet/003_acb20793.jpg ADDED

Git LFS Details

  • SHA256: 2d7f3e254678e0e9c921b4fad5873908c35877c3acd02cd27984c661600767bf
  • Pointer size: 130 Bytes
  • Size of remote file: 29.6 kB
celeb_dataset/Kate Winslet/004_0816d969.jpg ADDED

Git LFS Details

  • SHA256: 29abd59ed768b5e81db466b27531fd921be32ea28504018a6d5094d7dead4739
  • Pointer size: 130 Bytes
  • Size of remote file: 41.8 kB
celeb_dataset/Kate Winslet/005_93b2fce9.jpg ADDED

Git LFS Details

  • SHA256: cff8c6f4bfae82142ee5db6e6e5fd49a7924ca39102020d392e221c50c2cbb90
  • Pointer size: 130 Bytes
  • Size of remote file: 29.1 kB
celeb_dataset/Leonardo DiCaprio/001_08194468.jpg ADDED

Git LFS Details

  • SHA256: 4195c31984971cb5f22c356fbfd861c622c13bb519c38cef03d8493125338b73
  • Pointer size: 130 Bytes
  • Size of remote file: 23.6 kB
celeb_dataset/Leonardo DiCaprio/002_86e8aa58.jpg ADDED

Git LFS Details

  • SHA256: 1911a808af38c76469616eef8b0ea744667691f02fd6e5b62bf68294e8dc4f22
  • Pointer size: 130 Bytes
  • Size of remote file: 20.7 kB
celeb_dataset/Leonardo DiCaprio/003_85990366.jpg ADDED

Git LFS Details

  • SHA256: 3c61e9fa299eb74a65ec7cde407934e805a9ce2010b552a4e65e33c0d94ad889
  • Pointer size: 130 Bytes
  • Size of remote file: 24.1 kB
celeb_dataset/Leonardo DiCaprio/004_af012af1.jpg ADDED

Git LFS Details

  • SHA256: e2d007dcf9ec3db8001750e7fccbadd30af48e80c7cf4ffa03d5c4897a4578d1
  • Pointer size: 130 Bytes
  • Size of remote file: 27.5 kB
celeb_dataset/Leonardo DiCaprio/005_7fe5b764.jpg ADDED

Git LFS Details

  • SHA256: 3bec59c70f2c1aed7ea5cd367bfd3c91c2fd7360086f81cc67b6d8232fd4c8f3
  • Pointer size: 130 Bytes
  • Size of remote file: 35.7 kB
celeb_dataset/Megan Fox/001_dfb62d96.jpg ADDED

Git LFS Details

  • SHA256: e49bd801197af4ba7ff157edeacbefa239fd54fa71552d232592bc30cc58a89c
  • Pointer size: 130 Bytes
  • Size of remote file: 54.4 kB
celeb_dataset/Megan Fox/002_6e289116.jpg ADDED

Git LFS Details

  • SHA256: 95642dc1671560cb370d9b35ea0de72d44f4a279ad56d37ccd5a75cb441f1b51
  • Pointer size: 130 Bytes
  • Size of remote file: 41.8 kB
celeb_dataset/Megan Fox/003_61dd1e53.jpg ADDED

Git LFS Details

  • SHA256: 4e818459653c828f1d58b5217b01b40c9afbec766088bbada20e00ae7e64ec8e
  • Pointer size: 130 Bytes
  • Size of remote file: 54.9 kB
celeb_dataset/Megan Fox/004_6aede3d3.jpg ADDED

Git LFS Details

  • SHA256: 6380b05f1d2fd78b4907335ec3bc44a9987f5dc797e8f504f9646f44e9dac3ac
  • Pointer size: 130 Bytes
  • Size of remote file: 43.9 kB
celeb_dataset/Megan Fox/005_9574c208.jpg ADDED

Git LFS Details

  • SHA256: 712bd8476a06d6daa32c3ac5c4c7ff3298f89c498ceb1f2d2a58eaedc32a5654
  • Pointer size: 130 Bytes
  • Size of remote file: 45.7 kB
celeb_dataset/Natalie Portman/001_9cd1160a.jpg ADDED

Git LFS Details

  • SHA256: 240c748cd9c3e0080a917eb8080ffc142233e6cd0df4250eebceed90ae89f490
  • Pointer size: 130 Bytes
  • Size of remote file: 46.6 kB
celeb_dataset/Natalie Portman/002_3a2ef5df.jpg ADDED

Git LFS Details

  • SHA256: 95e8f5b03fced459a32bc504c6106e17aa8e160f109474c8eb8ac57907bc1640
  • Pointer size: 130 Bytes
  • Size of remote file: 20.3 kB
celeb_dataset/Natalie Portman/003_13b7bb9d.jpg ADDED

Git LFS Details

  • SHA256: aa4e122a416edde7ef545dd4718d0f7ebd1f12922fe4567dafe151a70f212c6a
  • Pointer size: 130 Bytes
  • Size of remote file: 28.7 kB