<jupyter_start><jupyter_text><jupyter_code>#IMPORTING REQUIREMENTS AND DATASET
!git clone https://github.com/ultralytics/yolov5  # clone repo
%cd yolov5
!git reset --hard 886f1c03d839575afecb059accf74296fad395b6
!pip install -qr requirements.txt  # install dependencies (ignore errors)
%cd /content
!curl -L "https://app.roboflow.com/ds/ktJuBlVrzC?key=Sdq5ibBm3v" > roboflow.zip; unzip roboflow.zip; rm roboflow.zip

!pip install -r https://raw.githubusercontent.com/ultralytics/yolov5/master/requirements.txt
%%time
%cd /content/yolov5/
!python train.py --img 640 --batch 30 --epochs 50  --data ../data.yaml --weights yolov5m.pt  --name yolov5s_results  --cache
%load_ext tensorboard
%tensorboard --logdir runs
from countpeople import *
#EX2
size_X,size_Y,fps = (640,640,30)
video_to_frame_path = ShrinkVideo('/content/video_ex02_Trim.mp4','/content/shrinked_video.mp4',size_X,size_Y,fps)
frames_to_video = defModel(video_to_frame_path,'custom',weights='/content/yolov5/runs/train/yolov5s_results3/weights/last.pt')
final_video_base = writevideo(frames_to_video,size_X,size_Y,fps)<jupyter_output>Using cache found in /root/.cache/torch/hub/ultralytics_yolov5_master
Fusing layers... 
/usr/local/lib/python3.7/dist-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at  /pytorch/c10/core/TensorImpl.h:1156.)
  return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)

Model Summary: 308 layers, 21037638 parameters, 0 gradients
Adding AutoShape... 
YOLOv5 🚀 2021-6-25 torch 1.9.0+cu102 CUDA:0 (Tesla T4, 15109.75MB)
{'fraction_non_alphanumeric': 0.11514104778353483, 'fraction_numerical': 0.059297639608520435, 'mean_word_length': 5.558490566037736, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '577670', 'license': 'MIT', 'n_tokens_mistral': 717, 'n_tokens_neox': 646, 'n_words': 139, 'path': 'Count_Find_Rifles.ipynb', 'repo_name': 'Mateus-Colaco/Apollo-Ex2-2021', 'size': '1737'}