diff --git a/PAR 152/MCL.py b/PAR 152/MCL.py new file mode 100644 index 0000000000000000000000000000000000000000..8e8302c38a55c19586d1c1ca4541aff11fda8983 --- /dev/null +++ b/PAR 152/MCL.py @@ -0,0 +1,177 @@ +import random as rd +from math import cos, sin +import numpy as np +import matplotlib.pyplot as plt + +### Carte ### + +pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] +pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] +diametre = 225 +centre_x, centre_y = 278, 200 +coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] +coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] + +coord_ext = [(i/diametre , j/diametre) for i,j in zip(pixel_x_ext, pixel_y_ext)] +coord_int = [(i/diametre , j/diametre) for i,j in zip(pixel_x_int, pixel_y_int)] + +### Paramètres ### +sigma_position = 0.02 +sigma_direction = 0.05 + + + +def normalisation(W): + a = sum(W) + return [w/a for w in W] + +def distance(x_1, y_1, x_2, y_2): + return np.sqrt((x_1-x_2)**2 + (y_1-y_2)**2) + +def distance_Chamfer(A_x, A_y, B_x, B_y): + m = len(A_x) + n = len(B_x) + + res = 0 + + tab = [[distance(A_x[i], A_y[i], B_x[j], B_y[j]) for i in range(m)] for j in range(n)] + tab = np.array(tab) + for i in range(m): + res += np.min(tab[:,i]) + for j in range(n): + res += np.min(tab[j,:]) + + return res + + +def motion_update(commande, position): + vitesse, direction = commande + x,y,theta = position + new_x = x + vitesse*cos(direction) + rd.gauss(0, sigma_position) + new_y = y + vitesse*sin(direction) + rd.gauss(0, sigma_position) + new_theta = theta - direction + rd.gauss(0, sigma_direction) + return (new_x, new_y, new_theta) + + + +def sensor_update(observation, position): + x,y,theta = position + vision_x = [] + vision_y = [] + vision_x_ext = [] + vision_y_ext = [] + for pt in coord_int: + vision_x.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) + vision_y.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) + + for pt in coord_ext: + vision_x_ext.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) + vision_y_ext.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) + + cones_vu_x = [] + cones_vu_y = [] + for i in range(len(vision_x)): + if vision_x[i]>0 and abs(vision_y[i])<vision_x[i]: + cones_vu_x.append(vision_x[i]) + cones_vu_y.append(vision_y[i]) + + for i in range(len(vision_x_ext)): + if vision_x_ext[i]>0 and abs(vision_y_ext[i])<vision_x_ext[i]: + cones_vu_x.append(vision_x_ext[i]) + cones_vu_y.append(vision_y_ext[i]) + + obs_x = [] + obs_y = [] + for i in observation: + obs_x.append(i[0]) + obs_y.append(i[1]) + + return distance_Chamfer(cones_vu_x, cones_vu_y, obs_x, obs_y) + + + + + + +def particle_filter(pos,u_t,z_t): #Position, commande, observation + X_t_barre, X_t = [], [] + M = len(pos) + for m in range(M): + x = motion_update(u_t, pos[m]) + w = sensor_update(z_t, x) + X_t_barre.append((x,w)) + + X = [X_t_barre[i][0] for i in range(M)] + W = [X_t_barre[i][1] for i in range(M)] + W = normalisation(W) + X_t = low_variance_resampling(X, W) + + return X_t,W + + +def low_variance_resampling(X,W): + X_t = [] + J = len(X) + r = rd.random()/J + c = W[0] + i=0 + for j in range(J): + U = r + (j-1)/J + while U > c: + i += 1 + c += W[i] + X_t.append(X[i]) + return X_t + +if __name__ == "__main__": + pos = [(1.314, 1.162, 3.14/3.6) for i in range(10)] + + liste_x = [0.37409758380473157, + 0.6517064494114153, + 0.23060853761333963, + 0.5278583908503303, + 0.14161368355256793, + 0.5134652832573952] + + liste_y = [0.14021924676581576, + -0.3119493901540909, + -0.3464004029844368, + 0.01390277627039628, + -0.2754514724880131, + -0.5902545559074325] + + observation = [] + for i in range(len(liste_x)): + observation.append((liste_x[i], liste_y[i])) + + commande = (0.138841, 0.3) + + a,W = particle_filter(pos, commande, observation) + print(a,W) + + pos_initiale = (1.314, 1.162, 3.14/3.6) + pos_finale = (1.4, 1.271, 3.14/5.5) + + + plt.figure(1) + plt.plot(pos_initiale[0], pos_initiale[1], 'o') + plt.arrow(pos_initiale[0], pos_initiale[1], 0.07*cos(pos_initiale[2]), 0.07*sin(pos_initiale[2])) + plt.plot(pos_finale[0], pos_finale[1], 'o') + plt.arrow(pos_finale[0], pos_finale[1], 0.07*cos(pos_finale[2]), 0.07*sin(pos_finale[2])) + + plt.plot(coord_x_ext, coord_y_ext,'+') + plt.plot(coord_x_int, coord_y_int,'+') + + pos_x = [] + pos_y = [] + for k in range(len(a)): + i = a[k] + pos_x.append(i[0]) + pos_y.append(i[1]) + plt.arrow(i[0], i[1], 0.07*cos(i[2]), 0.07*sin(i[2])) + plt.annotate(W[k], [i[0], i[1]]) + + plt.plot(pos_x,pos_y,'.') + + + plt.show() \ No newline at end of file diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/111.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/111.jpg new file mode 100644 index 0000000000000000000000000000000000000000..0c010316977ccbfa122c147cf024d7191a237560 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/111.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/111.png b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/111.png new file mode 100644 index 0000000000000000000000000000000000000000..f0ed494803626b01e135a5cc44761fc2695400e7 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/111.png differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/161.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/161.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b5e38a85bfe2c0b588a1a41e5f5b41f4442481b3 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/161.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/28.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/28.jpg new file mode 100644 index 0000000000000000000000000000000000000000..fa2c3f401141fd670eada8faf5d31b33e5c77e8c Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/28.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/8.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/8.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ddbb595eb4a93591f923c97270bbfbbc9f2a9a35 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/8.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2330.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2330.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..a8fc2b655a0bfca26b44eb6bb451b88b220f2cc0 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2330.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2331.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2331.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..e1a4b12813257676044d8c7de3cb4e73c59eb699 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2331.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2332.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2332.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..6274c9537784b3621f9f6e58a5ed9e3ad588d5d0 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2332.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2333.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2333.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..10f074a0c9e0d77c553b08873b8fae93b29ff5fb Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2333.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2334.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2334.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..cb1628546f3c8331c59e04c9a74c794120e0b8d2 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2334.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2335.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2335.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..57ebd4c66b0052788ff6f249c23ab856cabbb3bd Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2335.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2336.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2336.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..6dc691fedb5648481539aae874d419cce8a58804 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2336.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2337.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2337.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..4a08ef77d07821661f03b93f75d92510ae936ac1 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2337.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2338.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2338.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..07fc6712589036169979bb5e56715edbea5a39d2 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2338.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2339.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2339.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..0fc1d74369191568d8240de6aad619c297d3b9b7 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2339.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2340.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2340.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..0db4c735b3d2c24831105935ff38a45778c87456 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2340.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2341.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2341.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..70e0ec134b9c4f39ac7d77f03436468c5a2f8aad Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2341.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2342.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2342.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..8bb9ea06afbd964e8a3787e812ddb32e97e40fd1 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2342.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2343.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2343.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..8a845730bfdbaf89187326f102d78e2422355ad4 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2343.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2344.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2344.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..cf9dae8e98ede8dfa30bc347e3986d442eea0c80 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2344.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2345.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2345.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..bd2c347697356e2d16ade43b26353f357530ba2a Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2345.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2346.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2346.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..72b3204f4522812f9826f305c428981fdd2508e3 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2346.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2347.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2347.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..c5b8c962ebf1137ba94af58dbd8222c92a295089 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2347.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2348.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2348.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..dd5beed97001ae87d638c9b44c0e62fa83f51b64 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2348.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2349.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2349.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..4c3661b9f0e864bd6db10c7f63b6fbd644872c50 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2349.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2350.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2350.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..d205b02c83a840311698c3b9f07804389e750795 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2350.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2351.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2351.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..b91169f73d235a48e34f976f4510036e743bf9a6 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2351.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2352.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2352.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..278bd420de4cac0657832abf0f41bf0b1c98e338 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2352.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2353.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2353.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..c84330440fef6560207707f42f02a51595ed6c8e Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2353.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2354.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2354.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..5106aca4b3cb399c64d55787f247b6be30b0d31a Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2354.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2355.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2355.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..c0df7c4f4500beea119c6135cfe4225611654cf4 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2355.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2356.JPEG b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2356.JPEG new file mode 100644 index 0000000000000000000000000000000000000000..0623a9b22d144b56229cc1a16e19282b321f5608 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/IMG_2356.JPEG differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/cone_1.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/cone_1.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a240c9eeff112a5221e50166a21713154d02c8fc Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/cone_1.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/plot_detection_photo.jpg b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/plot_detection_photo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..5588e9af128f18ba37af5f41b9960bf03423dc6c Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/plot_detection_photo.jpg differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/product-image-1178993187_480x480.webp b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/product-image-1178993187_480x480.webp new file mode 100644 index 0000000000000000000000000000000000000000..407747b3a4273db5a60a9f8f40fd7b1141f33fa3 Binary files /dev/null and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/IMAGES/product-image-1178993187_480x480.webp differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/configs.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/configs.cpython-38.pyc index d3a4ca838ca29c6c4707835e500f74e77ea4b865..71a6c4344514685e4dd2bdd680f2f1f56321b8a8 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/configs.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/configs.cpython-38.pyc differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc index 82267b09b9de6311b4e2d4b0d365405dea5bc0f1..316235f8d585a76cfff84349b6803a28d8781c6a 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/utils.cpython-38.pyc differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov3.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov3.cpython-38.pyc index 90dd7af7ddaed494d6cfad3fdb620c2cc3e7380d..2c80759726b8ea7c5a1999902cb0385574a7e923 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov3.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov3.cpython-38.pyc differ diff --git a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov4.cpython-38.pyc b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov4.cpython-38.pyc index b68a3e727f1c7a55f5e5e01dafa4f5e506ed7b07..31c53cf3e9c35aa848f2da491bd725759cfac1ce 100644 Binary files a/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov4.cpython-38.pyc and b/PAR 152/Yolo V3/TensorFlow-2.x-YOLOv3-master/yolov3/__pycache__/yolov4.cpython-38.pyc differ diff --git a/PAR 152/carte_cones.py b/PAR 152/carte_cones.py index 15b45c0fc89ff587863f8f7efecad1f644e33305..f584b93fd0c3f559e577d31d13c39fa52c04af8d 100644 --- a/PAR 152/carte_cones.py +++ b/PAR 152/carte_cones.py @@ -1,7 +1,60 @@ +# -*- coding: utf-8 -*- +""" +Created on Fri Jan 27 11:53:00 2023 + +@author: paull +""" + +import matplotlib.pyplot as plt +from math import cos,sin + + pixel_x_ext, pixel_y_ext = [242, 220, 165, 110, 63, 33, 22, 34, 63, 110, 165, 220, 243, 310, 334, 388, 443, 490, 521, 531, 520, 489, 443, 388, 333, 310], [76, 64, 52, 64, 95, 141, 196, 252, 298, 330, 340, 328, 318, 316, 328, 339, 329, 298, 251, 196, 142, 95, 64, 53, 64, 77] pixel_x_int, pixel_y_int = [245, 238, 222, 196, 166, 134, 108, 91, 85, 90, 109, 134, 165, 196, 222, 239, 308, 314, 332, 358, 388, 419, 445, 462, 468, 462, 445, 419, 388, 359, 332, 314], [201, 167, 140, 123, 116, 123, 140, 165, 195, 228, 253, 270, 277, 270, 253, 227, 200, 226, 253, 270, 277, 270, 253, 228, 197, 166, 140, 122, 117, 123, 140, 166] diametre = 225 centre_x, centre_y = 278, 200 coord_x_ext, coord_y_ext = [i/diametre for i in pixel_x_ext], [i/diametre for i in pixel_y_ext] coord_x_int, coord_y_int = [i/diametre for i in pixel_x_int], [i/diametre for i in pixel_y_int] -print(coord_x_int, coord_x_int) \ No newline at end of file +print(coord_x_int, coord_x_int) + +coord_int = [(i/diametre , j/diametre) for i,j in zip(pixel_x_int, pixel_y_int)] +coord_ext = [(i/diametre , j/diametre) for i,j in zip(pixel_x_ext, pixel_y_ext)] +x = 1.4 +y = 1.271 +theta = 3.14/5.5 +vision_x = [] +vision_y = [] +vision_x_ext = [] +vision_y_ext = [] +for pt in coord_int: + vision_x.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) + vision_y.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) + +for pt in coord_ext: + vision_x_ext.append((pt[0]-x)*cos(theta) + (pt[1]-y)*sin(theta)) + vision_y_ext.append(-(pt[0]-x)*sin(theta) + (pt[1]-y)*cos(theta)) + + +plt.figure(1) +plt.plot(coord_x_ext, coord_y_ext,'+') +plt.plot(coord_x_int, coord_y_int,'+') +plt.arrow(x,y,0.1*cos(theta),0.1*sin(theta), width=0.01) +plt.show() + + +cones_vu_x = [] +cones_vu_y = [] +for i in range(len(vision_x)): + if vision_x[i]>0 and abs(vision_y[i])<vision_x[i]: + cones_vu_x.append(vision_x[i]) + cones_vu_y.append(vision_y[i]) + +for i in range(len(vision_x_ext)): + if vision_x_ext[i]>0 and abs(vision_y_ext[i])<vision_x_ext[i]: + cones_vu_x.append(vision_x_ext[i]) + cones_vu_y.append(vision_y_ext[i]) + +plt.figure(2) +plt.plot(cones_vu_x, cones_vu_y, '+') +plt.arrow(0,0,0.1,0,width=0.01) +plt.show() \ No newline at end of file