User Tools

Site Tools


cs501r_f2016:tmp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

cs501r_f2016:tmp [2016/11/09 18:21]
wingated
cs501r_f2016:tmp [2021/06/30 23:42]
Line 1: Line 1:
-====Objective:​==== 
  
-To gain experience coding a DNN architecture and learning program end-to-end, and to gain experience with Siamese network and ResNets. 
- 
----- 
-====Deliverable:​==== 
- 
-For this lab, you will need to implement a simple face similarity detector. 
- 
-  - You must implement a siamese network that accepts two input images 
-  - The network must output the probability that the two images are the same class 
-  - Your implementation should use a ResNet architecture 
- 
-You should turn in the following: 
- 
-  - A tensorboard screenshot showing that your architecture is, indeed, a siamese architecture 
-  - Your code 
-  - A small writeup (<1/2 page) describing your test/​training split, your resnet architecture,​ and the final performance of your classifier. 
- 
-You should use the [[http://​www.openu.ac.il/​home/​hassner/​data/​lfwa/​|Labeled Faces in the Wild-a]] dataset (also available for  
-[[http://​liftothers.org/​byu/​lfwa.tar.gz|download from liftothers]]). 
- 
----- 
-====Grading standards:​==== 
- 
-Your notebook will be graded on the following: 
- 
-  * 35% Correct implementation of Siamese network 
-  * 35% Correct implementation of Resnet 
-  * 20% Reasonable effort to find a good-performing topology 
-  * 10% Results writeup 
- 
----- 
-====Description:​==== 
- 
----- 
-====Hints:​==== 
- 
-To help you get started, here's a simple script that will load all of the images and calculate labels. ​ It assumes that the face database has been unpacked in the current directory, and that there exists a file called ''​list.txt''​ that was generated with the following command: 
- 
-<code bash> 
-find ./lfw2/ -name \*.jpg > list.txt 
-</​code>​ 
- 
-After running this code, the data will in the ''​data''​ tensor, and the labels will be in the ''​labels''​ tensor: 
- 
-<code python> 
- 
-from PIL import Image 
-import numpy as np 
- 
-# 
-# assumes list.txt is a list of filenames, formatted as 
-# 
-# ./​lfw2//​Aaron_Eckhart/​Aaron_Eckhart_0001.jpg 
-# ./​lfw2//​Aaron_Guiel/​Aaron_Guiel_0001.jpg 
-# ... 
-# 
- 
-files = open( '​./​list.txt'​ ).readlines() 
- 
-data = np.zeros(( len(files), 250, 250 )) 
-labels = np.zeros(( len(files), 1 )) 
- 
-# a little hash map mapping subjects to IDs 
-ids = {} 
-scnt = 0 
- 
-# load in all of our images 
-ind = 0 
-for fn in files: 
- 
-    subject = fn.split('/'​)[3] 
-    if not ids.has_key( subject ): 
-        ids[ subject ] = scnt 
-        scnt += 1 
-    label = ids[ subject ] 
-    ​ 
-    data[ ind, :, : ] = np.array( Image.open( fn.rstrip() ) ) 
-    labels[ ind ] = label 
-    ind += 1 
- 
-# data is (13233, 250, 250) 
-# labels is (13233, 1) 
- 
-</​code>​ 
cs501r_f2016/tmp.txt ยท Last modified: 2021/06/30 23:42 (external edit)