-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#! /bin/bash | ||
|
||
rm -rf homework_1 | ||
mkdir homework_1 | ||
hws=$(find . -wholename "*/lab0_intro/questions.md") | ||
for hw in ${hws[*]} | ||
do | ||
name=${hw:2} | ||
slash_i=$(( `expr index "$name" /` - 1 )) | ||
name=${name:0:$slash_i} | ||
echo $name | ||
cp $hw homework_1/$name.md | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#! /bin/bash | ||
|
||
echo NOT AVAILABLE > errors.txt | ||
|
||
while read u | ||
do | ||
REPO=https://github.com/$u/lab_vision | ||
#test connection | ||
echo $REPO | ||
wget -q --spider $REPO | ||
status=$? | ||
if [ $status -eq 0 ] | ||
then | ||
rm -rf $u | ||
git clone --progress https://github.com/$u/lab_vision $u | ||
else | ||
echo Not available | ||
echo $u >> errors.txt | ||
fi | ||
sleep 10 | ||
done < gh_users.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import hmac | ||
import base64 | ||
import glob | ||
import hashlib | ||
from itertools import izip | ||
import csv | ||
|
||
in_dir='/home/pabloa/imagenet_tiny/test' | ||
out_dir='/home/pabloa/imagenet_tiny/test_o' | ||
cats_file='/home/pabloa/imagenet_tiny/cats_o.csv' | ||
key='gBWJPpeNYUeotZfCXacO' | ||
|
||
os.chdir(in_dir) | ||
|
||
imgs = glob.glob('*/*.JPEG') | ||
hashes = [base64.urlsafe_b64encode(hmac.new(key,f,hashlib.sha1).hexdigest()) for f in imgs ] | ||
for f,o in izip(imgs,hashes): | ||
os.symlink(os.path.join(in_dir,f),os.path.join(out_dir,o+".JPEG")) | ||
|
||
with open(cats_file,"wb") as csv_file: | ||
w=csv.writer(csv_file) | ||
w.writerows(l for l in izip(hashes,(os.path.split(f)[0] for f in imgs)) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
function ps=rand_patches(im,pw,ph,np) | ||
w=size(im,1); | ||
h=size(im,2); | ||
ps=zeros(pw,ph,np); | ||
for i=1:np | ||
p_x=randi(w-pw); | ||
p_y=randi(h-ph); | ||
p=im(p_x:p_x+pw-1,p_y:p_y+ph-1); | ||
ps(:,:,i)=p; | ||
end | ||
end |