{
  "id": 297747,
  "title": "Inference Tips for YOLOv5 beginner?",
  "url": "/competitions/tensorflow-great-barrier-reef/discussion/297747",
  "author_name": "",
  "post_date": "2021-12-29T08:33:25.475168900Z",
  "votes": null,
  "comment_count": 1,
  "views": 0,
  "content": "<p><a href=\"https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-training\" target=\"_blank\">https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-training</a> </p>\n<p>I copy upper code and run it. Of course, I wantto summit inference code but I have trouble now. </p>\n<p><a href=\"https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-inference\" target=\"_blank\">https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-inference</a> </p>\n<p>For starting inference code, I downloaded best.pt from train code. </p>\n<p>And I made new inference code with offline.. But when I run inferece code above , I noticed I didn't have yolov5 file. </p>\n<p>In this situation, how can I do it? </p>\n<p>After running train code, I had yolov5 file but I can not download all of it. </p>\n<p><a href=\"https://www.kaggle.com/awsaf49/great-barrier-reef-yolov5-infer\" target=\"_blank\">https://www.kaggle.com/awsaf49/great-barrier-reef-yolov5-infer</a> </p>\n<p>this reference code has 'yolov5-lib-ds' file too. </p>\n<p>Should I need to download yolov5 file after running train code for inferece? </p>\n<p>Or Is there any more wise method I missed? </p>\n<p>If anyone has a solution to this problem, any advice would be appreciated. </p>\n<p>Thank you.</p>",
  "messages": [
    {
      "id": "1632137",
      "postDate": "12/29/2021 08:33:25",
      "content": "<p><a href=\"https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-training\" target=\"_blank\">https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-training</a> </p>\n<p>I copy upper code and run it. Of course, I wantto summit inference code but I have trouble now. </p>\n<p><a href=\"https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-inference\" target=\"_blank\">https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-inference</a> </p>\n<p>For starting inference code, I downloaded best.pt from train code. </p>\n<p>And I made new inference code with offline.. But when I run inferece code above , I noticed I didn't have yolov5 file. </p>\n<p>In this situation, how can I do it? </p>\n<p>After running train code, I had yolov5 file but I can not download all of it. </p>\n<p><a href=\"https://www.kaggle.com/awsaf49/great-barrier-reef-yolov5-infer\" target=\"_blank\">https://www.kaggle.com/awsaf49/great-barrier-reef-yolov5-infer</a> </p>\n<p>this reference code has 'yolov5-lib-ds' file too. </p>\n<p>Should I need to download yolov5 file after running train code for inferece? </p>\n<p>Or Is there any more wise method I missed? </p>\n<p>If anyone has a solution to this problem, any advice would be appreciated. </p>\n<p>Thank you.</p>",
      "rawMarkdown": "https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-training \n\nI copy upper code and run it. Of course, I wantto summit inference code but I have trouble now. \n\nhttps://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-inference \n\nFor starting inference code, I downloaded best.pt from train code. \n\nAnd I made new inference code with offline.. But when I run inferece code above , I noticed I didn't have yolov5 file. \n\nIn this situation, how can I do it? \n\nAfter running train code, I had yolov5 file but I can not download all of it. \n\nhttps://www.kaggle.com/awsaf49/great-barrier-reef-yolov5-infer \n\nthis reference code has 'yolov5-lib-ds' file too. \n\nShould I need to download yolov5 file after running train code for inferece? \n\nOr Is there any more wise method I missed? \n\nIf anyone has a solution to this problem, any advice would be appreciated. \n\nThank you.",
      "votes": null
    },
    {
      "id": "1632147",
      "postDate": "12/29/2021 09:06:40",
      "content": "<p>You have to do 2 steps for inference with YoloV5.<br>\nFirst, you should clone <a href=\"https://github.com/ultralytics/yolov5/\" target=\"_blank\">YoloV5 github repo</a> and upload it to kaggle as dataset.<br>\nSecond, you should download Arial.ttf file in internet because yolov5 depends on this file.</p>\n<p>1.Copy arial.ttf file to that directory.</p>\n<pre><code>!mkdir -p /root/.config/Ultralytics \n!cp ../input/arialttf/Arial.ttf /root/.config/Ultralytics/\n</code></pre>\n<p>2.And you can import your model to notebook with this code:</p>\n<pre><code>model = torch.hub.load('../input/your-yolov5-dataset',\n                             'custom',\n                       path = '../input/your-model-weights.pt',\n                       source = 'local',\n                       force_reload = True)\n</code></pre>",
      "rawMarkdown": "You have to do 2 steps for inference with YoloV5.\nFirst, you should clone [YoloV5 github repo](https://github.com/ultralytics/yolov5/) and upload it to kaggle as dataset.\nSecond, you should download Arial.ttf file in internet because yolov5 depends on this file.\n\n1.Copy arial.ttf file to that directory.\n```\n!mkdir -p /root/.config/Ultralytics \n!cp ../input/arialttf/Arial.ttf /root/.config/Ultralytics/\n```\n\n2.And you can import your model to notebook with this code:\n```\nmodel = torch.hub.load('../input/your-yolov5-dataset',\n                             'custom',\n                       path = '../input/your-model-weights.pt',\n                       source = 'local',\n                       force_reload = True)\n```",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 1632147,
      "author_name": "sarperyurttas",
      "author_url": "",
      "post_date": "12/29/2021 09:06:40",
      "content": "<p>You have to do 2 steps for inference with YoloV5.<br>\nFirst, you should clone <a href=\"https://github.com/ultralytics/yolov5/\" target=\"_blank\">YoloV5 github repo</a> and upload it to kaggle as dataset.<br>\nSecond, you should download Arial.ttf file in internet because yolov5 depends on this file.</p>\n<p>1.Copy arial.ttf file to that directory.</p>\n<pre><code>!mkdir -p /root/.config/Ultralytics \n!cp ../input/arialttf/Arial.ttf /root/.config/Ultralytics/\n</code></pre>\n<p>2.And you can import your model to notebook with this code:</p>\n<pre><code>model = torch.hub.load('../input/your-yolov5-dataset',\n                             'custom',\n                       path = '../input/your-model-weights.pt',\n                       source = 'local',\n                       force_reload = True)\n</code></pre>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "1632137": "https://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-training \n\nI copy upper code and run it. Of course, I wantto summit inference code but I have trouble now. \n\nhttps://www.kaggle.com/ammarnassanalhajali/barrier-reef-yolov5-inference \n\nFor starting inference code, I downloaded best.pt from train code. \n\nAnd I made new inference code with offline.. But when I run inferece code above , I noticed I didn't have yolov5 file. \n\nIn this situation, how can I do it? \n\nAfter running train code, I had yolov5 file but I can not download all of it. \n\nhttps://www.kaggle.com/awsaf49/great-barrier-reef-yolov5-infer \n\nthis reference code has 'yolov5-lib-ds' file too. \n\nShould I need to download yolov5 file after running train code for inferece? \n\nOr Is there any more wise method I missed? \n\nIf anyone has a solution to this problem, any advice would be appreciated. \n\nThank you.",
    "1632147": "You have to do 2 steps for inference with YoloV5.\nFirst, you should clone [YoloV5 github repo](https://github.com/ultralytics/yolov5/) and upload it to kaggle as dataset.\nSecond, you should download Arial.ttf file in internet because yolov5 depends on this file.\n\n1.Copy arial.ttf file to that directory.\n```\n!mkdir -p /root/.config/Ultralytics \n!cp ../input/arialttf/Arial.ttf /root/.config/Ultralytics/\n```\n\n2.And you can import your model to notebook with this code:\n```\nmodel = torch.hub.load('../input/your-yolov5-dataset',\n                             'custom',\n                       path = '../input/your-model-weights.pt',\n                       source = 'local',\n                       force_reload = True)\n```"
  },
  "source": "meta"
}