|  | 
| 136 | 136 |    "metadata": {}, | 
| 137 | 137 |    "outputs": [], | 
| 138 | 138 |    "source": [ | 
| 139 |  | -    "yolomodel = {\"config_path\":\"/home/adi/computer_vision/multi-object-tracker/yolo_dir/yolov3.cfg\",\n", | 
| 140 |  | -    "              \"model_weights_path\":\"/home/adi/computer_vision/multi-object-tracker/yolo_dir/yolov3.weights\",\n", | 
|  | 139 | +    "yolomodel = {\"config_path\":\"./yolo_dir/yolov3.cfg\",\n", | 
|  | 140 | +    "              \"model_weights_path\":\"./yolo_dir/yolov3.weights\",\n", | 
| 141 | 141 |     "              \"coco_names\":\"./yolo_dir/coco.names\",\n", | 
| 142 | 142 |     "              \"confidence_threshold\": 0.5,\n", | 
| 143 | 143 |     "              \"threshold\":0.3\n", | 
|  | 
| 201 | 201 |   }, | 
| 202 | 202 |   { | 
| 203 | 203 |    "cell_type": "code", | 
| 204 |  | -   "execution_count": 6, | 
|  | 204 | +   "execution_count": 8, | 
| 205 | 205 |    "metadata": {}, | 
| 206 | 206 |    "outputs": [], | 
| 207 | 207 |    "source": [ | 
| 208 |  | -    "video_src = \"./video_test2.mp4\"#0\n", | 
|  | 208 | +    "video_src = \"./data/video_test2.mp4\"#0\n", | 
| 209 | 209 |     "cap = cv.VideoCapture(video_src)" | 
| 210 | 210 |    ] | 
| 211 | 211 |   }, | 
|  | 
| 218 | 218 |   }, | 
| 219 | 219 |   { | 
| 220 | 220 |    "cell_type": "code", | 
| 221 |  | -   "execution_count": 7, | 
|  | 221 | +   "execution_count": 9, | 
| 222 | 222 |    "metadata": { | 
| 223 |  | -    "scrolled": true | 
|  | 223 | +    "scrolled": false | 
| 224 | 224 |    }, | 
| 225 | 225 |    "outputs": [ | 
| 226 | 226 |     { | 
|  | 
| 287 | 287 |     "                    0.5, (0, 255, 0), 2)\n", | 
| 288 | 288 |     "        cv.circle(image, (centroid[0], centroid[1]), 4, (0, 255, 0), -1)\n", | 
| 289 | 289 |     "        \n", | 
| 290 |  | -    "    #cv.imshow(\"image\", image)\n", | 
|  | 290 | +    "    cv.imshow(\"image\", image)\n", | 
| 291 | 291 |     "    \n", | 
| 292 | 292 |     "    if cv.waitKey(1) & 0xFF == ord('q'):\n", | 
| 293 | 293 |     "        break\n", | 
| 294 | 294 |     "        \n", | 
| 295 | 295 |     "    if writer is None:\n", | 
| 296 |  | -    "        # initialize our video writer\n", | 
| 297 | 296 |     "        fourcc = cv.VideoWriter_fourcc(*\"MJPG\")\n", | 
| 298 | 297 |     "        writer = cv.VideoWriter(\"output.avi\", fourcc, 30, (W, H), True)\n", | 
| 299 | 298 |     "    writer.write(image)\n", | 
| 300 | 299 |     "writer.release()\n", | 
| 301 | 300 |     "cap.release()\n", | 
| 302 |  | -    "#cv.destroyWindow(\"image\")" | 
|  | 301 | +    "cv.destroyWindow(\"image\")" | 
| 303 | 302 |    ] | 
| 304 | 303 |   }, | 
| 305 | 304 |   { | 
|  | 
0 commit comments