|
161 | 161 | "outputs": [
|
162 | 162 | {
|
163 | 163 | "data": {
|
164 |
| - "application/javascript": [ |
165 |
| - "\n", |
166 |
| - " setTimeout(function() {\n", |
167 |
| - " var nbb_cell_id = 6;\n", |
168 |
| - " var nbb_unformatted_code = \"# filepath = oriented_imagery_data.download(save_path = os.getcwd(), file_name=oriented_imagery_data.name)\\nfilepath = \\\"D:\\\\TrafficSignalDataset\\\\sample\\\\sample\\\\oriented_imagery_sample_notebook.zip\\\"\";\n", |
169 |
| - " var nbb_formatted_code = \"# filepath = oriented_imagery_data.download(save_path = os.getcwd(), file_name=oriented_imagery_data.name)\\nfilepath = \\\"D:\\\\TrafficSignalDataset\\\\sample\\\\sample\\\\oriented_imagery_sample_notebook.zip\\\"\";\n", |
170 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
171 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
172 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
173 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
174 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
175 |
| - " }\n", |
176 |
| - " break;\n", |
177 |
| - " }\n", |
178 |
| - " }\n", |
179 |
| - " }, 500);\n", |
180 |
| - " " |
181 |
| - ], |
| 164 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 6;\n var nbb_unformatted_code = \"# filepath = oriented_imagery_data.download(save_path = os.getcwd(), file_name=oriented_imagery_data.name)\\nfilepath = \\\"D:\\\\TrafficSignalDataset\\\\sample\\\\sample\\\\oriented_imagery_sample_notebook.zip\\\"\";\n var nbb_formatted_code = \"# filepath = oriented_imagery_data.download(save_path = os.getcwd(), file_name=oriented_imagery_data.name)\\nfilepath = \\\"D:\\\\TrafficSignalDataset\\\\sample\\\\sample\\\\oriented_imagery_sample_notebook.zip\\\"\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
182 | 165 | "text/plain": [
|
183 | 166 | "<IPython.core.display.Javascript object>"
|
184 | 167 | ]
|
|
221 | 204 | "outputs": [
|
222 | 205 | {
|
223 | 206 | "data": {
|
224 |
| - "application/javascript": [ |
225 |
| - "\n", |
226 |
| - " setTimeout(function() {\n", |
227 |
| - " var nbb_cell_id = 7;\n", |
228 |
| - " var nbb_unformatted_code = \"data_path = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"street_view_data\\\")\\nimage_meta_data = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"oriented_imagery_meta_data.csv\\\")\\ndepth_image_path = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"saved_depth_image\\\")\";\n", |
229 |
| - " var nbb_formatted_code = \"data_path = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"street_view_data\\\")\\nimage_meta_data = Path(\\n os.path.join(os.path.splitext(filepath)[0]), \\\"oriented_imagery_meta_data.csv\\\"\\n)\\ndepth_image_path = Path(\\n os.path.join(os.path.splitext(filepath)[0]), \\\"saved_depth_image\\\"\\n)\";\n", |
230 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
231 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
232 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
233 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
234 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
235 |
| - " }\n", |
236 |
| - " break;\n", |
237 |
| - " }\n", |
238 |
| - " }\n", |
239 |
| - " }, 500);\n", |
240 |
| - " " |
241 |
| - ], |
| 207 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 7;\n var nbb_unformatted_code = \"data_path = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"street_view_data\\\")\\nimage_meta_data = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"oriented_imagery_meta_data.csv\\\")\\ndepth_image_path = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"saved_depth_image\\\")\";\n var nbb_formatted_code = \"data_path = Path(os.path.join(os.path.splitext(filepath)[0]), \\\"street_view_data\\\")\\nimage_meta_data = Path(\\n os.path.join(os.path.splitext(filepath)[0]), \\\"oriented_imagery_meta_data.csv\\\"\\n)\\ndepth_image_path = Path(\\n os.path.join(os.path.splitext(filepath)[0]), \\\"saved_depth_image\\\"\\n)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
242 | 208 | "text/plain": [
|
243 | 209 | "<IPython.core.display.Javascript object>"
|
244 | 210 | ]
|
|
261 | 227 | "outputs": [
|
262 | 228 | {
|
263 | 229 | "data": {
|
264 |
| - "application/javascript": [ |
265 |
| - "\n", |
266 |
| - " setTimeout(function() {\n", |
267 |
| - " var nbb_cell_id = 8;\n", |
268 |
| - " var nbb_unformatted_code = \"image_path_list = [os.path.join(data_path,image) for image in os.listdir(data_path)]\";\n", |
269 |
| - " var nbb_formatted_code = \"image_path_list = [os.path.join(data_path, image) for image in os.listdir(data_path)]\";\n", |
270 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
271 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
272 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
273 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
274 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
275 |
| - " }\n", |
276 |
| - " break;\n", |
277 |
| - " }\n", |
278 |
| - " }\n", |
279 |
| - " }, 500);\n", |
280 |
| - " " |
281 |
| - ], |
| 230 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 8;\n var nbb_unformatted_code = \"image_path_list = [os.path.join(data_path,image) for image in os.listdir(data_path)]\";\n var nbb_formatted_code = \"image_path_list = [os.path.join(data_path, image) for image in os.listdir(data_path)]\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
282 | 231 | "text/plain": [
|
283 | 232 | "<IPython.core.display.Javascript object>"
|
284 | 233 | ]
|
|
315 | 264 | "outputs": [
|
316 | 265 | {
|
317 | 266 | "data": {
|
318 |
| - "application/javascript": [ |
319 |
| - "\n", |
320 |
| - " setTimeout(function() {\n", |
321 |
| - " var nbb_cell_id = 9;\n", |
322 |
| - " var nbb_unformatted_code = \"yolo = YOLOv3(pretrained_backbone=True)\";\n", |
323 |
| - " var nbb_formatted_code = \"yolo = YOLOv3(pretrained_backbone=True)\";\n", |
324 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
325 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
326 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
327 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
328 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
329 |
| - " }\n", |
330 |
| - " break;\n", |
331 |
| - " }\n", |
332 |
| - " }\n", |
333 |
| - " }, 500);\n", |
334 |
| - " " |
335 |
| - ], |
| 267 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 9;\n var nbb_unformatted_code = \"yolo = YOLOv3(pretrained_backbone=True)\";\n var nbb_formatted_code = \"yolo = YOLOv3(pretrained_backbone=True)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
336 | 268 | "text/plain": [
|
337 | 269 | "<IPython.core.display.Javascript object>"
|
338 | 270 | ]
|
|
373 | 305 | "outputs": [
|
374 | 306 | {
|
375 | 307 | "data": {
|
376 |
| - "application/javascript": [ |
377 |
| - "\n", |
378 |
| - " setTimeout(function() {\n", |
379 |
| - " var nbb_cell_id = 10;\n", |
380 |
| - " var nbb_unformatted_code = \"def traffic_light_finder(oriented_image_path):\\n flag = 0\\n coordlist = []\\n temp_list = {}\\n out = yolo.predict(oriented_image_path, threshold=0.5)\\n test_img = cv2.imread(oriented_image_path)\\n if len(out[0]) == 0:\\n temp_list[\\\"object\\\"] = False\\n else:\\n for index, (value, label, confidence) in enumerate(zip(out[0], out[1], out[2])):\\n if label == \\\"traffic light\\\":\\n flag = 1\\n coordlist.append(\\n [int(value[0]), int(value[1]), int(value[2]), int(value[3])]\\n )\\n test_img = cv2.rectangle(\\n test_img,\\n (int(value[0]), int(value[1]), int(value[2]), int(value[3])),\\n (0, 0, 255),\\n 10,\\n )\\n textvalue = label + \\\"_\\\" + str(confidence)\\n cv2.putText(\\n test_img,\\n textvalue,\\n (int(value[0]), int(value[1]) - 10),\\n cv2.FONT_HERSHEY_SIMPLEX,\\n 1.5,\\n (0, 0, 255),\\n 2,\\n )\\n if flag == 1:\\n temp_list[\\\"object\\\"] = True\\n temp_list[\\\"coords\\\"] = coordlist\\n temp_list[\\\"assetname\\\"] = \\\"traffic light\\\"\\n return temp_list, test_img\";\n", |
381 |
| - " var nbb_formatted_code = \"def traffic_light_finder(oriented_image_path):\\n flag = 0\\n coordlist = []\\n temp_list = {}\\n out = yolo.predict(oriented_image_path, threshold=0.5)\\n test_img = cv2.imread(oriented_image_path)\\n if len(out[0]) == 0:\\n temp_list[\\\"object\\\"] = False\\n else:\\n for index, (value, label, confidence) in enumerate(zip(out[0], out[1], out[2])):\\n if label == \\\"traffic light\\\":\\n flag = 1\\n coordlist.append(\\n [int(value[0]), int(value[1]), int(value[2]), int(value[3])]\\n )\\n test_img = cv2.rectangle(\\n test_img,\\n (int(value[0]), int(value[1]), int(value[2]), int(value[3])),\\n (0, 0, 255),\\n 10,\\n )\\n textvalue = label + \\\"_\\\" + str(confidence)\\n cv2.putText(\\n test_img,\\n textvalue,\\n (int(value[0]), int(value[1]) - 10),\\n cv2.FONT_HERSHEY_SIMPLEX,\\n 1.5,\\n (0, 0, 255),\\n 2,\\n )\\n if flag == 1:\\n temp_list[\\\"object\\\"] = True\\n temp_list[\\\"coords\\\"] = coordlist\\n temp_list[\\\"assetname\\\"] = \\\"traffic light\\\"\\n return temp_list, test_img\";\n", |
382 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
383 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
384 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
385 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
386 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
387 |
| - " }\n", |
388 |
| - " break;\n", |
389 |
| - " }\n", |
390 |
| - " }\n", |
391 |
| - " }, 500);\n", |
392 |
| - " " |
393 |
| - ], |
| 308 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 10;\n var nbb_unformatted_code = \"def traffic_light_finder(oriented_image_path):\\n flag = 0\\n coordlist = []\\n temp_list = {}\\n out = yolo.predict(oriented_image_path, threshold=0.5)\\n test_img = cv2.imread(oriented_image_path)\\n if len(out[0]) == 0:\\n temp_list[\\\"object\\\"] = False\\n else:\\n for index, (value, label, confidence) in enumerate(zip(out[0], out[1], out[2])):\\n if label == \\\"traffic light\\\":\\n flag = 1\\n coordlist.append(\\n [int(value[0]), int(value[1]), int(value[2]), int(value[3])]\\n )\\n test_img = cv2.rectangle(\\n test_img,\\n (int(value[0]), int(value[1]), int(value[2]), int(value[3])),\\n (0, 0, 255),\\n 10,\\n )\\n textvalue = label + \\\"_\\\" + str(confidence)\\n cv2.putText(\\n test_img,\\n textvalue,\\n (int(value[0]), int(value[1]) - 10),\\n cv2.FONT_HERSHEY_SIMPLEX,\\n 1.5,\\n (0, 0, 255),\\n 2,\\n )\\n if flag == 1:\\n temp_list[\\\"object\\\"] = True\\n temp_list[\\\"coords\\\"] = coordlist\\n temp_list[\\\"assetname\\\"] = \\\"traffic light\\\"\\n return temp_list, test_img\";\n var nbb_formatted_code = \"def traffic_light_finder(oriented_image_path):\\n flag = 0\\n coordlist = []\\n temp_list = {}\\n out = yolo.predict(oriented_image_path, threshold=0.5)\\n test_img = cv2.imread(oriented_image_path)\\n if len(out[0]) == 0:\\n temp_list[\\\"object\\\"] = False\\n else:\\n for index, (value, label, confidence) in enumerate(zip(out[0], out[1], out[2])):\\n if label == \\\"traffic light\\\":\\n flag = 1\\n coordlist.append(\\n [int(value[0]), int(value[1]), int(value[2]), int(value[3])]\\n )\\n test_img = cv2.rectangle(\\n test_img,\\n (int(value[0]), int(value[1]), int(value[2]), int(value[3])),\\n (0, 0, 255),\\n 10,\\n )\\n textvalue = label + \\\"_\\\" + str(confidence)\\n cv2.putText(\\n test_img,\\n textvalue,\\n (int(value[0]), int(value[1]) - 10),\\n cv2.FONT_HERSHEY_SIMPLEX,\\n 1.5,\\n (0, 0, 255),\\n 2,\\n )\\n if flag == 1:\\n temp_list[\\\"object\\\"] = True\\n temp_list[\\\"coords\\\"] = coordlist\\n temp_list[\\\"assetname\\\"] = \\\"traffic light\\\"\\n return temp_list, test_img\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
394 | 309 | "text/plain": [
|
395 | 310 | "<IPython.core.display.Javascript object>"
|
396 | 311 | ]
|
|
500 | 415 | "outputs": [
|
501 | 416 | {
|
502 | 417 | "data": {
|
503 |
| - "application/javascript": [ |
504 |
| - "\n", |
505 |
| - " setTimeout(function() {\n", |
506 |
| - " var nbb_cell_id = 14;\n", |
507 |
| - " var nbb_unformatted_code = \"with open('traffic_light_data_sample.json', 'w') as f:\\n json.dump(data_list, f)\";\n", |
508 |
| - " var nbb_formatted_code = \"with open(\\\"traffic_light_data_sample.json\\\", \\\"w\\\") as f:\\n json.dump(data_list, f)\";\n", |
509 |
| - " var nbb_cells = Jupyter.notebook.get_cells();\n", |
510 |
| - " for (var i = 0; i < nbb_cells.length; ++i) {\n", |
511 |
| - " if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n", |
512 |
| - " if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n", |
513 |
| - " nbb_cells[i].set_text(nbb_formatted_code);\n", |
514 |
| - " }\n", |
515 |
| - " break;\n", |
516 |
| - " }\n", |
517 |
| - " }\n", |
518 |
| - " }, 500);\n", |
519 |
| - " " |
520 |
| - ], |
| 418 | + "application/javascript": "\n setTimeout(function() {\n var nbb_cell_id = 14;\n var nbb_unformatted_code = \"with open('traffic_light_data_sample.json', 'w') as f:\\n json.dump(data_list, f)\";\n var nbb_formatted_code = \"with open(\\\"traffic_light_data_sample.json\\\", \\\"w\\\") as f:\\n json.dump(data_list, f)\";\n var nbb_cells = Jupyter.notebook.get_cells();\n for (var i = 0; i < nbb_cells.length; ++i) {\n if (nbb_cells[i].input_prompt_number == nbb_cell_id) {\n if (nbb_cells[i].get_text() == nbb_unformatted_code) {\n nbb_cells[i].set_text(nbb_formatted_code);\n }\n break;\n }\n }\n }, 500);\n ", |
521 | 419 | "text/plain": [
|
522 | 420 | "<IPython.core.display.Javascript object>"
|
523 | 421 | ]
|
|
1118 | 1016 | "m.center = {'x': 25.28489583988743, 'y': 54.70681816057357,\n",
|
1119 | 1017 | " 'spatialReference': {'wkid': 4326, 'latestWkid': 4326}}\n",
|
1120 | 1018 | "m.zoom = 19\n",
|
1121 |
| - "m.basemap = 'satellite'" |
| 1019 | + "m.basemap.basemap = 'satellite'" |
1122 | 1020 | ]
|
1123 | 1021 | },
|
1124 | 1022 | {
|
|
1128 | 1026 | "metadata": {},
|
1129 | 1027 | "outputs": [],
|
1130 | 1028 | "source": [
|
| 1029 | + "from arcgis.map.symbols import SimpleMarkerSymbolEsriSMS\n", |
| 1030 | + "\n", |
1131 | 1031 | "for point in outpoints:\n",
|
1132 | 1032 | " intpoint = {'x': point[0], 'y': point[1],\n",
|
1133 | 1033 | " 'spatialReference': {'wkid': 102100,\n",
|
1134 | 1034 | " 'latestWkid': 3857}}\n",
|
1135 |
| - " m.draw(arcgis.geometry.Point(intpoint), symbol={\n", |
1136 |
| - " 'type': 'simple-marker',\n", |
1137 |
| - " 'style': 'square',\n", |
1138 |
| - " 'color': 'red',\n", |
1139 |
| - " 'size': '8px',\n", |
1140 |
| - " })" |
| 1035 | + " m.content.draw(arcgis.geometry.Point(intpoint), symbol=SimpleMarkerSymbolEsriSMS(**{\n", |
| 1036 | + " 'style': 'esriSMSSquare',\n", |
| 1037 | + " 'color': [255,0,0],\n", |
| 1038 | + " 'size': 8,\n", |
| 1039 | + " }))" |
1141 | 1040 | ]
|
1142 | 1041 | },
|
1143 | 1042 | {
|
|
0 commit comments