Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
LeC-D committed Dec 21, 2018
1 parent 085453b commit b67f783
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 19 deletions.
5 changes: 1 addition & 4 deletions Projet/Bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def run(self):
nw_letter = i[0]
nw_desc = [float(j) for j in re.findall(r"[\d.]+", i)]
dist_actu = DescriptorGenerator.distance(desc_i, nw_desc)
print(dist_actu, ' ', nw_letter)
if dist_actu < min_diff:
min_diff = dist_actu
letter_actu = nw_letter
Expand All @@ -54,10 +55,6 @@ def run(self):
else:
img = np.asarray(Image.open(p['input_image']).convert('L'))
res = Pipeline().run(img)
test = np.asarray(res[0])
t = Image.fromarray(test)
plot = plt.imshow(t)
plt.show()
print(res[1])


Expand Down
12 changes: 1 addition & 11 deletions Projet/BoundaryTracing/BoudaryTracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ def flush(self):
self.miny = None
self.maxy = None

# def optimal_y_level(self):
# print(self.maxy)
# print(self.miny)
# dy = self.maxy - self.miny
# optimaly = math.floor(0.33 * dy)
# return optimaly

def initial_trace_direction(self):
self.initial_trace_point = (0, 0)
for i in range(self.minx, self.maxx):
Expand Down Expand Up @@ -130,10 +123,7 @@ def trace(self):
if br == 2000:
print('hello')
break
# test = np.asarray(self.image)
# t = Image.fromarray(test)
# plot = plt.imshow(t)
# plt.show()

return [mask, fingertip, ret_points]

def calcul_minx(self):
Expand Down
4 changes: 0 additions & 4 deletions Projet/Pipeline/Pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@ def run(self, input):
edges_image = self.edgeDetec.detect_edges(input)
clipped_image = self.clip.clip(edges_image)
bound_image_data = self.boundTrac.run(clipped_image)
test = np.asarray(clipped_image)
t = Image.fromarray(test)
plot = plt.imshow(t)
plt.show()
return bound_image_data
Binary file modified Projet/Pipeline/__pycache__/Pipeline.cpython-35.pyc
Binary file not shown.
7 changes: 7 additions & 0 deletions Projet/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1. python3 et pip3 doivent être installé préalablemment sur la machine pour que le code soit exécutable
2. Appeler le script configure.sh: sh configure.sh
3. Pour exécuter la fonctionnalité de l'article(prédire le nombre de doigts levés), exécuter la commande : python3 Main.py -i <image du signe a evaluer­­>
4. Pour entrainer le modèle pour la classification: python3 Main.py -m training
5. Pour classifier une image: python3 Main.py -m classification -i <image du signe a evaluer­­>
6. Pour voir toutes les options disponibles : python3 Main.py -h
7. Pour entrainer un nouveau modèle, il faut tout d'abord effacer le dernier modèle
8 changes: 8 additions & 0 deletions Projet/TrainedModel/model.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
l1.0 0.9886313261973856 0.9772047725728248 0.9657746123152318 0.9544108668081015 0.9430958457951536 0.9317388494016104 0.920402854335435 0.9089975231231584 0.8976785449994307 0.8864096334358293 0.8750702218313482 0.8637831231836044 0.8525010664051405 0.8412772553760819 0.8300644250778888 0.8188846300851933 0.8077280304571433 0.7966288375514582 0.7854463833800481
k1.0 0.9890627882870118 0.9782829326972156 0.9674863521904538 0.956866694995331 0.9461545671250953 0.9355640241069237 0.9249872258319893 0.9144955222106349 0.9039873220128651 0.8934687466801673 0.8829877804977714 0.8725835462755951 0.8622110014706869 0.851791511046461 0.8414312611982354 0.8311457952825035 0.8209161550728566 0.8107271068871501 0.8005378277464835
w1.0 0.9870267806503344 0.9735362460720288 0.9592011029025258 0.9444022989991473 0.9297016926464909 0.9151825506371228 0.9006585487464958 0.886078303648402 0.8716498276384175 0.8572174514383347 0.8427728456855207 0.8283871042253792 0.8139705129568293 0.7997401909060731 0.7854649036910545 0.7713265261892785 0.7571625616602837 0.7431998005953263 0.7293491527161432
f1.0 0.9909766928148457 0.981913793867278 0.9729159200132932 0.9639032400225703 0.9548842260070639 0.9458745952659744 0.9368670203501704 0.9278850208101751 0.918888478304557 0.9099011066950535 0.9009319996927229 0.8919469882340932 0.8829966311604174 0.8740314694311492 0.8650507613342873 0.8560921775643651 0.8471387147037911 0.8381668533120411 0.8292185503444749
i1.0 0.9900330805393018 0.9799267684402521 0.969930105294399 0.959881692786049 0.9499156444225191 0.9398973109387505 0.9299774093264649 0.9200253729792116 0.9100629703796151 0.9001260117635439 0.8901920518403313 0.8801535582036658 0.8700370433409732 0.86009749990915 0.850073645335427 0.8399486477413898 0.8298637313668864 0.8198221593662403 0.8097006638519503
v1.0 0.9908625429770358 0.9812518791129468 0.9712776041163959 0.9608201778717635 0.9504642891241538 0.9400845283761637 0.9296254565969266 0.9192627027758454 0.9089493279242049 0.8988023964646481 0.8885606365705078 0.8783739810800189 0.8682272127224749 0.8580528867725095 0.8479810197435752 0.8378830644394221 0.8278841577993532 0.8177546513048264 0.8077600172155925
u1.0 0.990458439758131 0.9809945324129336 0.9715460351773836 0.9620734074294379 0.9526160991975022 0.9432082954380068 0.9337661627924588 0.9243103782572862 0.9148578948608076 0.9053949760523091 0.8959455305382876 0.8865070039223456 0.8771391752180615 0.8677121618699647 0.8582783900101427 0.8488472646547812 0.8394453664053069 0.8300278380951315 0.8206303887905347
b1.0 0.9907304352236308 0.9810954099217086 0.9714609406327653 0.9619155900916428 0.9523781397271012 0.9428540324598401 0.9332770587485351 0.9237059365225558 0.9142210614543377 0.9046273708905108 0.8950912494060923 0.8855549966533088 0.8760235850325813 0.8665141183845557 0.8569448773155468 0.8474593414751496 0.8379623097120816 0.8284928692949312 0.8190007298770767
Binary file modified Projet/__pycache__/Bootstrap.cpython-35.pyc
Binary file not shown.
Binary file modified Projet/asl_alphabet_test/B_test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Projet/asl_alphabet_test/L_test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions Projet/configure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo apt-get build-dep python3-scipy
sudo pip3 install scipy
sudo pip3 install argparse
sudo pip3 install pillow
sudo pip3 install numpy
sudo pip3 install opencv-python

0 comments on commit b67f783

Please sign in to comment.