Created using Colaboratory
parent
38737bdafa
commit
934d5d1a8a
|
@ -65,7 +65,7 @@
|
|||
"import utils\n",
|
||||
"display = utils.notebook_init() # checks"
|
||||
],
|
||||
"execution_count": 1,
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
|
@ -118,7 +118,7 @@
|
|||
"!python detect.py --weights yolov5s.pt --img 640 --conf 0.25 --source data/images\n",
|
||||
"# display.Image(filename='runs/detect/exp/zidane.jpg', width=600)"
|
||||
],
|
||||
"execution_count": 13,
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
|
@ -174,7 +174,7 @@
|
|||
"torch.hub.download_url_to_file('https://ultralytics.com/assets/coco2017val.zip', 'tmp.zip') # download (780M - 5000 images)\n",
|
||||
"!unzip -q tmp.zip -d ../datasets && rm tmp.zip # unzip"
|
||||
],
|
||||
"execution_count": 3,
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
|
@ -198,7 +198,7 @@
|
|||
"# Validate YOLOv5s on COCO val\n",
|
||||
"!python val.py --weights yolov5s.pt --data coco.yaml --img 640 --half"
|
||||
],
|
||||
"execution_count": 4,
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
|
@ -308,7 +308,7 @@
|
|||
"# Train YOLOv5s on COCO128 for 3 epochs\n",
|
||||
"!python train.py --img 640 --batch 16 --epochs 3 --data coco128.yaml --weights yolov5s.pt --cache"
|
||||
],
|
||||
"execution_count": 5,
|
||||
"execution_count": null,
|
||||
"outputs": [
|
||||
{
|
||||
"output_type": "stream",
|
||||
|
@ -593,7 +593,7 @@
|
|||
"# YOLOv5 PyTorch HUB Inference (DetectionModels only)\n",
|
||||
"import torch\n",
|
||||
"\n",
|
||||
"model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True) # yolov5n - yolov5x6 or custom\n",
|
||||
"model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True, trust_repo=True) # or yolov5n - yolov5x6 or custom\n",
|
||||
"im = 'https://ultralytics.com/images/zidane.jpg' # file, Path, PIL.Image, OpenCV, nparray, list\n",
|
||||
"results = model(im) # inference\n",
|
||||
"results.print() # or .show(), .save(), .crop(), .pandas(), etc."
|
||||
|
|
Loading…
Reference in New Issue