-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.html
188 lines (184 loc) · 5.73 KB
/
admin.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lost&Found</title>
<meta name="description" content="Find your near and dear ones in case of a natural calamity.">
<meta name="keywords" content="Find your near and dear ones in case of a natural calamity.">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway|Candal">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style1.css">
</head>
<body>
<p>{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"ppl_db = {1: [\"shilpa\", 36, \"path1\", \"path2\", \"path3\"],\n",
"2: [\"arun\", 40, \"path1\", \"path2\", \"path3\"],\n",
"3: [\"sindhu\", 7, \"path1\", \"path2\", \"path3\"],\n",
"4: [\"varun\", 4, \"path1\", \"path2\", \"path3\"],\n",
" \n",
"5: [\"neigh1\", 30, \"path1\", \"path2\", \"path3\"],\n",
"6: [\"friend1\", 25, \"path1\", \"path2\", \"path3\"], \n",
"7: [\"colleague1\", 25, \"path1\", \"path2\", \"path3\"]}"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"bloodRelation_db = {1: [2,3,4], 2: [1,3,4], 3: [1,2,4], 4: [1,2,3]}\n",
"neighbour_db = {1: [5], 2: [5], 3: [5], 4: [5], 5:[1,2,3,4]}\n",
"friend_db = {1: [6]}\n",
"colleague_db = {1: [7]}"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"# Get person's identity using iris, face, fingerpring\n",
"def get_iris_match(iris):\n",
" return 1\n",
"def get_face_match(face_img):\n",
" return 1\n",
"def get_fingerprint_match(fingerprint):\n",
" return 1"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"# Get person's blood relatives, neighbours, friend, colleague\n",
"def get_bloodRelation(id):\n",
" return bloodRelation_db[id]\n",
"def get_neighbour(id):\n",
" return neighbour_db[id]\n",
"def get_friend(id):\n",
" return friend_db[id]\n",
"def get_colleague(id):\n",
" return colleague_db[id]"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"def get_personIdentity(face_img = \"face_img\", iris = \"iris\", fingerprint = \"fp\"):\n",
" id_retrieved = []\n",
" if face_img:\n",
" id_retrieved.append(get_iris_match(face_img))\n",
" if iris:\n",
" id_retrieved.append(get_face_match(iris))\n",
" if fingerprint:\n",
" id_retrieved.append(get_fingerprint_match(fingerprint))\n",
" return id_retrieved"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"[[2, 3, 4], [5], [6], [7]]\n"
]
}
],
"source": [
"id_retrieved = get_personIdentity()\n",
"\n",
"acquaintances = []\n",
"for _id in set(id_retrieved):\n",
" acquaintances.append(get_bloodRelation(_id))\n",
" acquaintances.append(get_neighbour(_id))\n",
" acquaintances.append(get_friend(_id))\n",
" acquaintances.append(get_colleague(_id))\n",
"all_acquaintances = sum(acquaintances, [])"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
"disaster_known_ppl_db = {5: 'in rehab 1', 7:'in hospital 1'}\n",
"disaster_unknown_ppl_db = {6: 'in hospital 2'}"
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"acquaintance neigh1 in rehab 1\n",
"acquaintance friend1 in hospital 2\n",
"acquaintance colleague1 in hospital 1\n"
]
}
],
"source": [
"for acquaintance in all_acquaintances:\n",
" if acquaintance in disaster_known_ppl_db.keys():\n",
" print(\"acquaintance %s %s\" %(ppl_db[acquaintance][0], disaster_known_ppl_db[acquaintance]))\n",
" if acquaintance in disaster_unknown_ppl_db.keys():\n",
" print(\"acquaintance %s %s\" %(ppl_db[acquaintance][0], disaster_unknown_ppl_db[acquaintance])) "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
</p>
</body>
</html>