Official YOLO v7 Custom Object Detection Tutorial | Windows & Linux

Поділитися
Вставка
  • Опубліковано 20 сер 2024

КОМЕНТАРІ • 368

  • @amirhosinipur355
    @amirhosinipur355 2 роки тому +27

    Thanks a lot for a very effective, fast and complete, tutorial, not wasting people time.

  • @sanawar428
    @sanawar428 Рік тому +4

    Thanks a lot. I have been trying to train a model for a week and finally I found this gem. I was having an issue regarding numpy: AttributeError: module 'numpy' has no attribute 'int'. The problem was with the latest version of numpy. I ran "pip install --upgrade numpy==1.23.5" and it fixed the issue.

  • @rahmadyd
    @rahmadyd 6 місяців тому

    Thank you, dude. I have already completed my thesis using the algorithm. God Bless U

  • @connectrRomania
    @connectrRomania Рік тому +1

    Man keep these simple efficient videos about SOTA CV models, thanks alot ❤

  • @sicco9326
    @sicco9326 Рік тому

    Have not tried it yet but its the best tutorial I could find. Very good content!

  • @user-so2ot9sy3r
    @user-so2ot9sy3r Рік тому +1

    Thank you very much!Everything works perfectly (except for a few issues here and there,but it was all solved at the end),i really appreciate this!

    • @khenpahilanga9596
      @khenpahilanga9596 Рік тому

      hello, I require assistance because when I run detect it doesnt detect jack sparrow's face, and my highest accuracy was only 0.78 :(

    • @jayeshamalhotra9737
      @jayeshamalhotra9737 11 місяців тому

      ​@@khenpahilanga9596 I am having the same issue....we're you able to resolve it?

  • @user-vg8tf3cf4m
    @user-vg8tf3cf4m Рік тому

    what a nice tutorial! This video makes me surprised and more easier to realize the mechanism of yolov7.

  • @ZCVD
    @ZCVD Рік тому +1

    Hello. I run it on laptop with RTX 3060, 6Gb vram. But it runs only if batch-size is 1. Otherwise it doesn't work, an error occurs: RuntimeError: CUDA out of memory. Tried to allocate 1.92 GiB (GPU 0; 6.00 GiB total capacity; 545.16 MiB already allocated; 3.80 GiB free; 588.00 MiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF. I use 2000 images for training.

    • @DprTech
      @DprTech 10 місяців тому

      same here

  • @journeywithwolf3958
    @journeywithwolf3958 5 місяців тому +1

    I followed the steps that you mentioned in the video and I tried 4-5 times to train the model but in the end, after training it did not detect Jack Sparrow's face in the image when trying to give an input image

  • @Davida_dev
    @Davida_dev Рік тому

    Thank you! Helped me a lot in my school project :D Amazing video :D

  • @riyaz8072
    @riyaz8072 2 роки тому

    your channel is gold mine

  • @hughmungus8784
    @hughmungus8784 2 роки тому

    Amazing my friend thank you for posting this

  • @HasanAYousef
    @HasanAYousef Рік тому

    great one appreciate your efforts, thanks a lot

  • @abdelhamidazanzal4403
    @abdelhamidazanzal4403 Рік тому +3

    Thanks for this great and clear tuto. Can you make another video on yolov7 object detection in real time using webcam?

  • @MayankDayal1234
    @MayankDayal1234 Рік тому +1

    Hello.. I am getting following error..
    while installing pip install -r requirements_gpu.txt
    ERROR: Could not find a version that satisfies the requirement torch==1.11.0+cu113 (from versions: 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1)
    ERROR: No matching distribution found for torch==1.11.0+cu113
    Any suggestion?

    • @TheCodingBug
      @TheCodingBug  Рік тому

      See how I created requirements_gpu.txt ... Follow that to create for new version.

    • @MayankDayal1234
      @MayankDayal1234 Рік тому

      @@TheCodingBug it worked.. :)

    • @rohangupta8142
      @rohangupta8142 Рік тому

      @@MayankDayal1234 what version did you go with please tell?

    • @rushabhdayannavar3675
      @rushabhdayannavar3675 7 місяців тому

      @MayankDayal1234 i am also getting same error plz say how did you debug it

  • @nafilal-alawi4911
    @nafilal-alawi4911 Рік тому

    Thanks for sharing your knowledge

  • @HaoNguyen-lj4ft
    @HaoNguyen-lj4ft Рік тому +3

    Thank you so much, I’m doing my final year project and this video helps me so much.
    But i have a question. If i trained it to detect 1 object after that i want to train it to detect another object but still keep the previous one. How can i do that?

    • @theos-ai-sales
      @theos-ai-sales Рік тому

      Here's their UA-cam channel with tutorials on how to use it: ua-cam.com/channels/5gLr7dLtV3Xe0eJvHOImNA.html

  • @anthonydesmet6813
    @anthonydesmet6813 Рік тому +1

    Holy shit this was amazing

  • @catalinavram3187
    @catalinavram3187 Рік тому

    Great tutorial!

  • @dungenwalkerr619
    @dungenwalkerr619 11 місяців тому

    You are a hero.

  • @brunospfc8511
    @brunospfc8511 2 роки тому +2

    LabelImg only create boxes, it is possible to do Instance segmentation in this Yolo ? What label-software to use?

  • @ariouathanane
    @ariouathanane Рік тому

    Awesome, thank you!

  • @pavantripathi1890
    @pavantripathi1890 2 роки тому

    Thanks for the video!

  • @ranati2000
    @ranati2000 Рік тому +1

    Hi,
    I am having this error
    RuntimeError: CUDA error: no kernel image is available for execution on the device
    Whereas my cuda and pytorch versions are the same
    Name: torch
    Version: 1.11.0+cu113
    I had 11.6 but i changed it to 11.3 now it should work but its not and iam stuck now.
    EDIT: I have gtx 770 which is old. But i want to run yolo can i run only on cpu ? As i have installed only cpu pytorch but it gave this error:
    AssertionError: CUDA unavailable, invalid device -1 requested
    Please Assist ASAP

  • @tahmidtowsifahmed6324
    @tahmidtowsifahmed6324 Рік тому +1

    Hi. I’m having an error while training.
    AssertionError: Label class 15 exceeds no=1 in data/custom_data.yaml. Possible class labels are 0-0.
    Not sure how to solve this.

  • @bhargavkowlagi4971
    @bhargavkowlagi4971 2 роки тому +2

    File "C:\capstone\yolov7_custom\yolov7-custom\train.py", line 592, in
    device = select_device(opt.device, batch_size=opt.batch_size)
    File "C:\capstone\yolov7_custom\yolov7-custom\utils\torch_utils.py", line 71, in select_device
    assert torch.cuda.is_available(), f'CUDA unavailable, invalid device {device} requested' # check availability
    AssertionError: CUDA unavailable, invalid device 0 requested
    What should be done for this error?

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      You do not have cuda installed (or do not have nvidia GPU).
      If you have nvidia GPU, update the drivers and install pytorch with cuda support.

    • @dhruvinkanani670
      @dhruvinkanani670 2 роки тому +3

      Remove -device 0 from command line argument when you run the program

    • @minastiktok5250
      @minastiktok5250 Рік тому +1

      you have to recreate a new environment and then redownload pytorch in that environment and then try the training cmd. it works for me.

    • @isnaayu_m
      @isnaayu_m Рік тому

      @@dhruvinkanani670 could you help me, I get error
      Cum_counts = np.cumsum(no.greater(counts,0,dtype=np.int64))
      TypeError: No loop matching the specified signature and casting was found for ufunc greater.

    • @rafaelrosa6898
      @rafaelrosa6898 Рік тому

      @@isnaayu_m could you fix this error?

  • @ubuntulinux81
    @ubuntulinux81 Рік тому +1

    I am getting this type of error what could be the reason
    assert mlc < nc, 'Label class %g exceeds nc=%g in %s. Possible class labels are 0-%g' % (mlc, nc, opt.data, nc - 1)
    AssertionError: Label class 15 exceeds nc=5 in data/custom.yaml. Possible class labels are 0-4

    • @TheCodingBug
      @TheCodingBug  Рік тому

      In your annotations, you have class label 15 but you've mentioned number of classes = 4.

    • @ubuntulinux81
      @ubuntulinux81 Рік тому

      @@TheCodingBug no i have five classes and same number of classes i have mention in cfg and coco file

  • @ChrisHalden007
    @ChrisHalden007 Рік тому

    Great video. Thanks

  • @p.o4872
    @p.o4872 Рік тому +1

    Hello good sir, I'm trying to train multiple objects at once but I'm getting "AssertionError: Label class 2 exceeds nc=2 in data/custom_data.yaml. Possible class labels are 0-1". I've already change number of classes to 2. What have went wrong here?

  • @md.hafizurrahman1565
    @md.hafizurrahman1565 2 роки тому +2

    Great video! no time wasting. Can you please tell me how can I train coco format labeling data for instant segmentation?

    • @TheCodingBug
      @TheCodingBug  2 роки тому +1

      I am planning the video for the next week.

  • @pierfrancescomariasanti2958
    @pierfrancescomariasanti2958 Рік тому +2

    Hi Sir, as told you in the recent past, thank you so much for your effort producing this awesome minicourses. I'd like so much if you could produce a Yolov7 or Yolov8 detect video for Raspberry Pi. What's your thought regarding this idea?

  • @leticiarosa286
    @leticiarosa286 Рік тому +2

    qt.qpa.xcb: could not connect to display
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/home/ec2-user/anaconda3/envs/yolov7_custom/lib/python3.9/site-packages/cv2/qt/plugins" even though it was found.
    What should be done for this error?

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Looks like you are running the script on a system with only CLI (without GUI). You would not be able to use functions that use the graphical output (such as cv2.imshow()).

    • @leticiarosa286
      @leticiarosa286 Рік тому

      @@TheCodingBug i'm using SageMaker terminal in AWS, what i can do in this case?

  • @albertrg9166
    @albertrg9166 Рік тому +1

    Very clear! Such a nice video :)
    I just have a few questions...
    Would it be possible to do the inference with the pretrained weights (for instance, base yolov7) detecting only one class (for instance, person; or car)?
    In case it is, could yo please explain how?
    Regards

    • @TheCodingBug
      @TheCodingBug  Рік тому +2

      Yes it's possible. Follow pretrained yolo v7 tutorial (if you haven't already) and use flag
      --classes 0
      to detect person class only. Detail about this flag is discussed here ua-cam.com/video/K_OGcfXwskc/v-deo.html

    • @albertrg9166
      @albertrg9166 Рік тому

      Thank you so much! Now I am facing another problem...
      For my custom dataset, my images are non squared, they are 1280x720. I saw a flag "--rect" in order to show I am not using squared images for training. How should I define the "--img-size" flag? I don't think it is just typing 1280 720; but I don't find anything relevant surfing on the Internet.

  • @prasannaravijr1420
    @prasannaravijr1420 11 місяців тому +1

    It says: ERROR: Could not find a version that satisfies the requirement torch==1.11.0+cu113 (from versions: none)
    ERROR: No matching distribution found for torch==1.11.0+cu113
    when i try to install requirements_gpu.txt

    • @TheCodingBug
      @TheCodingBug  11 місяців тому

      Install latest version of pytorch gpu with the command taken directly from official website.

    • @prasannaravijr1420
      @prasannaravijr1420 11 місяців тому

      But won't it exceed the required Version?
      If not pls give the line I needed

    • @TheCodingBug
      @TheCodingBug  11 місяців тому

      You'd be able to find previous versions there too. But in my experience, latest version is still compatible.

    • @prasannaravijr1420
      @prasannaravijr1420 11 місяців тому

      @@TheCodingBug thank you

  • @melihcankilic5918
    @melihcankilic5918 Рік тому

    awasome, thank you

  • @SauravKumar-fv8uj
    @SauravKumar-fv8uj Рік тому +1

    How much gpu memory is required to run on local system. Is 2GB is enough to train with 1000 images.

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      Maybe if you use batch size of 2 or 4, it would work on 2GB GPU.

  • @tugbayildizli3828
    @tugbayildizli3828 Рік тому +4

    Thank you for this amazing video. But, I am having some problems. When I run detect.py, no bounding box appears. Where is the problem coming from? I have Detectron and OpenCV installed. Are these necessary to visualize bounding boxes? I hope you can help me.

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Detectron is not necessary. Opencv is.
      With regards to no bounding box, check precision and recall graphs in training folder (where best.pt file is located). If it has really small values, the model is struggling to learn and you need more data for training.

    • @tugbayildizli3828
      @tugbayildizli3828 Рік тому +1

      ​@@TheCodingBug Actually I wanted to test the detection with pre-trained weights by calling "python detect.py --weights yolov7.pt --source inference/images/horses.jpg --img 640". But, no bounding boxes appears in horses.jpg.
      I have approximately 2000 images for 4 classes. I trained the model in YOLOv5, thanks to your videos. I got 0.65-0.70 mAP. I trained the model in YOLOv7, but precision and recall stayed under 0.001 too low.
      I guess the problem comes from former issue. Is there any idea to solve this?

    • @TheCodingBug
      @TheCodingBug  Рік тому

      @@tugbayildizli3828 Check the other video for pretrained model. ua-cam.com/video/n2mupnfIuFY/v-deo.html
      See if it works properly. If not, try updating Nvidia drivers for GPU usage or try CPU device instead of GPU.

    • @tugbayildizli3828
      @tugbayildizli3828 Рік тому +1

      @@TheCodingBug Thank you for your response. I used CUDA 11.3. I installed CUDA 10.2 and the problem solved.

    • @pierfrancescomariasanti2958
      @pierfrancescomariasanti2958 Рік тому

      @@TheCodingBug Hi SIr, I'm on the same situation. What does it means "...you need more data for traing"? Maybe more images (I have 57 images on Train folder). Thanks in advance

  • @connectrRomania
    @connectrRomania Рік тому +1

    I got no bounding box on the result image, is it because I used only 3 images for training?

  • @skp4160
    @skp4160 Рік тому +1

    I am getting AssertionError: Label class 12 exceeds nc=1 in data/custom-data.yaml. Possible class labels are 0-0

    • @TheCodingBug
      @TheCodingBug  Рік тому

      You have specified number of classes as 1 but have more classes in labels

  • @angelospapadopoulos7679
    @angelospapadopoulos7679 Рік тому

    hello great video. Question: how the official YOLOv7 wants the bounding box format to be? Just like COCO format [xmin, ymin, width, height] or like previous YOLOs [xcenter, ycenter, width, height]?

  • @sirishadanda4263
    @sirishadanda4263 Рік тому +1

    Hey there.
    I got an error while executing the command to train even when I followed the exact same steps shown in the video. This is the error:
    assert torch.cuda.is_available(), f'CUDA unavailable, invalid device {device} requested' # check availability
    AssertionError: CUDA unavailable, invalid device 0 requested
    Can u please tell how to rectify it

  • @portnet
    @portnet Рік тому +1

    if we run a webcam on this are we able to log detections and if for example class x detected then take screenshot and check for class y - if class y found crop - enhance image and then run ocr and then log result in a database?

    • @TheCodingBug
      @TheCodingBug  Рік тому

      No. You will have to modify the code to implement these specific functionalities.

  • @drekkerscythe4723
    @drekkerscythe4723 Рік тому +1

    Can I use labelme instead of labelImg? Whenever I use labelImg rectbox, it automatically terminates. Also whenever I install pip, the new directory 'labels' does not appear

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Use label studio instead

    • @ArunkumarN-dg1fz
      @ArunkumarN-dg1fz Рік тому +1

      How to install label studio

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      @@ArunkumarN-dg1fz pip install label-studio
      Then run it using command
      label-studio

  • @khenpahilanga9596
    @khenpahilanga9596 Рік тому

    Hello, thanks for this video, straight to the point and no time wasted, I just wanna ask after the first training of custom dataset. how do i add more dataset unto the first trained custom dataset yolo? do i use the best weights if i wanna continue adding more dataset to improve accuracy and more classes? becuz i wanna train my yolo while it retains the previous data is was trained with without starting from scratch, so i was wondering if u could help me with that. Thank you alot :)

  • @Adventure1844
    @Adventure1844 2 роки тому +1

    Is there a way in Yolo not just to Annotate , but also to remove Background ? Where i can find?

    • @TheCodingBug
      @TheCodingBug  2 роки тому +1

      No it's not possible without semantic segmentation.

    • @Adventure1844
      @Adventure1844 2 роки тому

      @@TheCodingBug OK, thank you👍🏻, but which repository should I use ?

  • @arsh9974
    @arsh9974 Рік тому +2

    how can we put this in a .py file so that we can use webcam support and acctually do stuff with the object detection

    • @TheCodingBug
      @TheCodingBug  Рік тому

      This is already a .py file!
      If you want to use webcam, just use --source 0 instead of video path.

    • @arsh9974
      @arsh9974 Рік тому

      @@TheCodingBug Namespace(weights='yolov7.pt', cfg='cfg/training/yolov7-custom.yaml', data='data/custom-data.yaml', hyp='data/hyp.scratch.custom.yaml', epochs=100, batch_size=8, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='0', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=1, project='runs/train', entity=None, name='yolov7-custom', exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias='latest', freeze=[0], v5_metric=False, world_size=1, global_rank=-1, save_dir='runs\\train\\yolov7-custom4', total_batch_size=8)
      tensorboard: Start with 'tensorboard --logdir runs/train', view at localhost:6006/
      hyperparameters: lr0=0.01, lrf=0.1, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.3, cls_pw=1.0, obj=0.7, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.2, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, paste_in=0.0, loss_ota=1
      wandb: Install Weights & Biases for YOLOR logging with 'pip install wandb' (recommended)
      fatal: not a git repository (or any of the parent directories): .git
      Traceback (most recent call last):
      File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\utils\google_utils.py", line 26, in attempt_download
      assets = [x['name'] for x in response['assets']] # release assets
      KeyError: 'assets'
      During handling of the above exception, another exception occurred:
      Traceback (most recent call last):
      File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\train.py", line 616, in
      train(hyp, opt, device, tb_writer)
      File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\train.py", line 86, in train
      attempt_download(weights) # download if not found locally
      File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\utils\google_utils.py", line 31, in attempt_download
      tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
      File "C:\ProgramData\Anaconda3\envs\yolov7\lib\subprocess.py", line 424, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "C:\ProgramData\Anaconda3\envs\yolov7\lib\subprocess.py", line 528, in run
      raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command 'git tag' returned non-zero exit status 128.

  • @Abstract_Code
    @Abstract_Code Рік тому +1

    Great tutorial, but when I start training I get this error:
    (ModuleNotFoundError: No module named 'numpy')
    I tried installing numpy with (pip install numpy) but it tells me (Requirement already satisfied: numpy), I did everything you did properly but how can I fix this?

  • @behnammashhadi7022
    @behnammashhadi7022 Рік тому

    Thank you so much, You solve my problem with your video. I wish you could do also real-time detection with camera :(

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      Use --source 0 instead of video file for camera.

  • @nurulnajwakhamis2680
    @nurulnajwakhamis2680 Рік тому

    hello sir. thank you for the explanation. i try to deploy with my 30 minutes video duration but turns out the detection video becomes 16 minutes. does it related to fps?

  • @remiel0731
    @remiel0731 2 роки тому +1

    I use colab to train it, but it's not good. my mAP@.5:.95: just "0.3x" i follow your step, epochs 100 batch_size 8
    should i train more epochs? or add more images?

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Add more images.

    • @remiel0731
      @remiel0731 2 роки тому +1

      @@TheCodingBug ok thank you!! I watch in 10:27 you just add less than 10 images in training, your mAP@.5:.95: have 0.6x in 10:47
      I have a little confuse, how much images need to add.

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      @@remiel0731 I have 10 images in validation, for training, I have 50+ images.

    • @remiel0731
      @remiel0731 2 роки тому

      @@TheCodingBug Sorry to bother you. I'm realize than I just need to give more images to help it make great that's all, don't think to much....😂😂

  • @mihirshah1717
    @mihirshah1717 Рік тому

    Hey, can you tell what is the format for annotation which yolov7 accepts, I cannot use labelmg as it is company work. I saw on google the format it accepts is class,x_centre,y_centre,w,h all normalized. Even after using this format I am not getting any detections. Can you help me by telling the format which yolov7 accepts.
    Edit - I figured my annotation format is correct, but still I am not able to get even a single detection on any image. what do you think might be the reason??

  • @vitorhugoRH
    @vitorhugoRH Рік тому

    at 3:03 I get the error " name 'labelImg' is not defined". I installed the labelImg fine but when I want to open it by writing "labelImg" its doesn't work.

  • @stephencolbert934
    @stephencolbert934 Рік тому +2

    Hi, nice video. Really Helpful. But I have a problem when training. I have this error:
    MP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
    I searched around and they say the solution is to install all packages without MKL support:
    conda install nomkl
    is this a good solution? I mean is it because my CPU is old? It is Intel(R) Core(TM) i7-7700 CPU

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      I am not sure. Never encountered this error.

    • @stephencolbert934
      @stephencolbert934 Рік тому

      @@TheCodingBug Oh ok, I will try it on a new comp and see what happen. Thanks for the reply.

    • @stephencolbert934
      @stephencolbert934 Рік тому +1

      Just an update in case someone had the same issue as me. I found out what the problem was. It is because of torchaudio package which was installed on my env. I noticed that in this video you remove torchaudio from the installation whereas in one of your other first videos you just copied the line from pytorch website which has torchaudio in it. I basically remake the env without torchaudio and everything works fine. Thanks again for the well made tutorial.

    • @TheCodingBug
      @TheCodingBug  Рік тому

      @@stephencolbert934 I am glad you were able to solve the problem.

    • @kazio13579
      @kazio13579 Рік тому

      ​@@stephencolbert934 hello can u give more info? I have the same problem and i dont know what i should change... ;/

  • @Vislooo
    @Vislooo Рік тому

    Could you please explain the steps needed to train more on top of initial training?
    What steps to take after doing all the steps in this video(ways to move through yolov7-custom folder/anaconda prompt)?
    What files need to be deleted/altered?
    Generally, what do i need to do to train again to add more classes/img’s/annotations?
    Thank you very much.

    • @khenpahilanga9596
      @khenpahilanga9596 Рік тому

      hello, have u gotten an answer regarding your question? I would also like to know

  • @user-mw7uy9uz5f
    @user-mw7uy9uz5f Рік тому

    I am using same method but show wrong output like above the image show clock to predicted every image . How to solve the problem?

  • @mikebrave-makesgames5365
    @mikebrave-makesgames5365 Рік тому

    getting an error when trying to train about no labels existing, even though the images were labelled and are in the correct dir, tried searching online and coming up at a loss - scanning images and labels... 0 found, 126 missing, 0 empty, 0 corrupted: 100% - AssertionError: train: no labels in data\train\Images.cache. Can not train without labels.

    • @sarpalgan2220
      @sarpalgan2220 Рік тому

      Your labels in "data\train\labels" folder must be in txt format. Check if they are in .xml format and change them to .txt format.

  • @phudinhtruong
    @phudinhtruong 2 роки тому

    another great video. tks u

  • @harshmirdhwal
    @harshmirdhwal Рік тому

    Hello, I am trying to train a model on custom plant images the model gets trained but does not detect correctly and makes no bounding box, is it because of underfitting, because I have only 60 images of a plant specie, is there any way to train the model with low number of images

  • @ripalnakiya
    @ripalnakiya Рік тому

    Please make a video on how to custom train already custom trained model
    for example : I trained model for detecting trash and wants to improve the accuracy, so I again want to train the model with different dataset

  • @somosamigoslocos
    @somosamigoslocos Рік тому +1

    Hi, this is a very nice video man! I have a question, is it possible to convert this model to TFLite following the same steps that you did on YOLO v4 video? Thanks a lot!

  • @shririri30
    @shririri30 Рік тому +1

    Hello brother , can you please let me know what is the software you used to modify the official files ? At 7.25 .
    Please reply soon , I need it urgently for my University Project

  • @rizaalamsyah3946
    @rizaalamsyah3946 Рік тому

    hello could you please help me, i train dataset but train also show 0 label in the box. and when i try to test, there is no bounding box label. whats wrong with my dataset ?

  • @brunospfc8511
    @brunospfc8511 2 роки тому +1

    Thanks, good simple tutorials, but i must say the patreon is pricy for brazil and many other countries, you have good content and you know how to work it, maybe invest more on UA-cam videos/memberships

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Thank you for the valuable suggestion. I am considering these options.

  • @Vislooo
    @Vislooo Рік тому

    I tried training for tomatoes and tomato leafs but all the bounding boxes came up labeled as tomatoes. Is there a way to make it so leafs are detected as leafs and tomatoes are detected as tomatoes? I labeled them differently in labelImg so i dont know how they came up with same label after running detection. @TheCodingBug

  • @alexanderdong9959
    @alexanderdong9959 2 роки тому +1

    At the final step of running the custom object detector part I get an error saying that 1.jpeg does not exist when I am positive that I have it in the yolov7-custom folder. Any suggestions pls

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Check if it's extension really is jpeg.

    • @alexanderdong9959
      @alexanderdong9959 2 роки тому

      @@TheCodingBug
      Traceback (most recent call last):
      File "C:\Users\alexa\OneDrive\Documents\Comp Sci\YOLOv7_Custom\yolov7-custom\detect.py", line 195, in
      detect()
      File "C:\Users\alexa\OneDrive\Documents\Comp Sci\YOLOv7_Custom\yolov7-custom\detect.py", line 57, in detect
      dataset = LoadImages(source, img_size=imgsz, stride=stride)
      File "C:\Users\alexa\OneDrive\Documents\Comp Sci\YOLOv7_Custom\yolov7-custom\utils\datasets.py", line 138, in __init__
      raise Exception(f'ERROR: {p} does not exist')
      Exception: ERROR: C:\Users\alexa\OneDrive\Documents\Comp Sci\YOLOv7_Custom\yolov7-custom\1.jpeg does not exist
      This is the error message that I get

    • @alexanderdong9959
      @alexanderdong9959 2 роки тому

      @@TheCodingBug I checked if the extension was jpeg and it was

    • @kjs8303
      @kjs8303 Рік тому +1

      I solved the problem that change path(english+my own language -> only english)

  • @ariouathanane
    @ariouathanane Рік тому +1

    Hello, i use 457 images for training and 196 for validation, but i have MAP very low 0.064!! please any recommandation?

  • @anasmdnassar
    @anasmdnassar 2 роки тому +1

    Thank you so much! What does workers = 1 mean in the training command? Appreciate your help

    • @TheCodingBug
      @TheCodingBug  2 роки тому

      Number of workers for data loading.

  • @prudhvinarayana5331
    @prudhvinarayana5331 10 місяців тому +1

    My pc is not having cuda availability. Can I have any alternative... Like running same in Google colab??

    • @TheCodingBug
      @TheCodingBug  10 місяців тому

      Yes you can. Yolov7 on colab tutorial is also there on my channel.

  • @armandomisista
    @armandomisista Рік тому

    Hello Sir, have you planned to do similar videos regarding the new Yolov8? It should be very interesting

  • @khaledsamir2667
    @khaledsamir2667 2 роки тому

    Great video, but we need more video about tracking objects

    • @akshayvasav2497
      @akshayvasav2497 2 роки тому

      great ...can you make video on yolo v7 with darknet?

  • @ethanchan9163
    @ethanchan9163 Рік тому

    My lebels are generated by labelImg, but why the system log corrupted: 100%, and it can not go traing....

  • @NeuralNetwork-go5zn
    @NeuralNetwork-go5zn Рік тому

    hi, can i ask yuo which yolov8 version should I choose to train the model on a custom dataset? (yolov8m, yolov8l, ...)

  • @arsh9974
    @arsh9974 Рік тому +1

    can you please tell me what im doing wrong
    (yolov7) C:\Users\Arsh\Desktop\arshaim\yolov7-custom>python train.py --workers 1 --device 0 --batch-size 4 --epochs 100 --img 640 640 --data data/custom-data.yaml --hyp data/hyp.scratch.custom.yaml --cfg cfg/training/yolov7-custom.yaml --name yolov7-custom --weights yolov7.pt
    YOLOR 2022-10-7 torch 1.11.0+cu113 CUDA:0 (NVIDIA GeForce GTX 1650, 4095.6875MB)
    Namespace(weights='yolov7.pt', cfg='cfg/training/yolov7-custom.yaml', data='data/custom-data.yaml', hyp='data/hyp.scratch.custom.yaml', epochs=100, batch_size=8, img_size=[640, 640], rect=False, resume=False, nosave=False, notest=False, noautoanchor=False, evolve=False, bucket='', cache_images=False, image_weights=False, device='0', multi_scale=False, single_cls=False, adam=False, sync_bn=False, local_rank=-1, workers=1, project='runs/train', entity=None, name='yolov7-custom', exist_ok=False, quad=False, linear_lr=False, label_smoothing=0.0, upload_dataset=False, bbox_interval=-1, save_period=-1, artifact_alias='latest', freeze=[0], v5_metric=False, world_size=1, global_rank=-1, save_dir='runs\\train\\yolov7-custom8', total_batch_size=8)
    tensorboard: Start with 'tensorboard --logdir runs/train', view at localhost:6006/
    hyperparameters: lr0=0.01, lrf=0.1, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.3, cls_pw=1.0, obj=0.7, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.2, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0, paste_in=0.0, loss_ota=1
    wandb: Install Weights & Biases for YOLOR logging with 'pip install wandb' (recommended)
    fatal: not a git repository (or any of the parent directories): .git
    Traceback (most recent call last):
    File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\utils\google_utils.py", line 26, in attempt_download
    assets = [x['name'] for x in response['assets']] # release assets
    KeyError: 'assets'
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
    File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\train.py", line 616, in
    train(hyp, opt, device, tb_writer)
    File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\train.py", line 86, in train
    attempt_download(weights) # download if not found locally
    File "C:\Users\Arsh\Desktop\arshaim\yolov7-custom\utils\google_utils.py", line 31, in attempt_download
    tag = subprocess.check_output('git tag', shell=True).decode().split()[-1]
    File "C:\ProgramData\Anaconda3\envs\yolov7\lib\subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "C:\ProgramData\Anaconda3\envs\yolov7\lib\subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command 'git tag' returned non-zero exit status 128.

  • @anziledge326
    @anziledge326 Рік тому

    Can we do this in tensorflow, because i already have cuda 11.2 and cudnn 8.1. But i am not getting gpu support for pytorch

  • @qaisjoker8306
    @qaisjoker8306 Рік тому

    I get this error when i try to train
    No loop matching the specified signature and casting was found for ufunc greater
    Can I please know the reason?

  • @k-gemas
    @k-gemas Рік тому

    very helpful, thank you a lot.

  • @TragicGFuel
    @TragicGFuel 6 місяців тому +2

    What's your PC specs? I wanna know just to get a rough idea of compute time in training

    • @TheCodingBug
      @TheCodingBug  6 місяців тому

      I am using GTX 1060 Laptop with coreI7 and 16GB DDR4 RAM.

    • @TragicGFuel
      @TragicGFuel 6 місяців тому +1

      @@TheCodingBug oh, well the ram information is less relevant.
      What's the VRAM on the 1060?
      It would seem my 3060 desktop gpu is an ideal choice as I can train yolo on it in a relatively shorter time!

    • @TheCodingBug
      @TheCodingBug  6 місяців тому

      @TragicGFuel 1060 is 6GB.
      3060 is faster, probably 2x.

    • @TragicGFuel
      @TragicGFuel 6 місяців тому +2

      @@TheCodingBug after some reasearch it seems that the VRAM being 12GB is a real boost to the training.
      The fact that I can overclock it is also a bonus.

  • @shearolfe6458
    @shearolfe6458 Рік тому

    ModuleNotFoundError: no module named ‘numpy’
    I have installed numpy plz help this is occurring on the python train command section

  • @QuarktaschemitSenf
    @QuarktaschemitSenf Рік тому

    Hi there @TheCodingBug! First of all thank you for this Video!
    I have two Questions:
    1. Can you maybe make a deep dive Video for this? I mean i could perform the custom training. But it still just runs in cmd-window. Can you maybe make a detailed guide on the main-function and which parts do what? . For example which lines to modifiy in the code if i want to for example modifiy the output of yolo? In v3 i wrote a function that only outputs sth if a person is detected , but no text output for anything else. How to do this in yolov7?
    2. Also im highly interested in transfer learning. In this video we made a custom model with just one class. But how can i for example add new custom detections to the already existing coco-model ?

  • @croust1501
    @croust1501 Рік тому

    Any suggestions for getting my mAP values up? Almost all my mAP 0.5s are very low numbers for each epoch and it doesn't detect the jack sparrow face even at --conf 0.1

    • @ammar46
      @ammar46 10 місяців тому

      Hey, could you solve it??

  • @Vanquish69
    @Vanquish69 Рік тому +1

    Excellent video. Is there an easy way to estimate the distance to detected vehicles?

    • @canercay5
      @canercay5 Рік тому

      If you have a stero camera you can measure detected object distance. Yolo is giving coordinates of objects. Stero camera can use this coordinates and can take distance. We are working on autonoums car and we are detecting traffic sign and their distance for writing best algorithms.

  • @karthiksubramani6296
    @karthiksubramani6296 Рік тому

    Thanks a lot for the video. I just have a question. After training the custom dataset, I want to detect the objects in an RTSP Livestream and there is a significant difference in resolution of the real RTSP stream which I stream using VLC and the stream which is out of the YOLOV7 algorithm meaning I can't see some of the detections happening in the livestream( I find the original video is somewhat zoomed)but I can see the complete detections in the saved video once I close detect.py
    Is there a way to adjust the resolution of the Rtsp stream? Thanks to reply on the same :)

  • @zombiefreak5780
    @zombiefreak5780 Рік тому

    hello, i have a question why is my mAP very low like the accuracy is only 0.2-0.3 did i miss any modifications? ive ran 3 training already but the accuracy is very bad :(

    • @ammar46
      @ammar46 10 місяців тому

      Did you solve it?

  • @arunkumarms4479
    @arunkumarms4479 Рік тому +1

    8.43- How the runs folder is created

    • @TheCodingBug
      @TheCodingBug  Рік тому

      It's created automatically when you run inferencing

  • @BENHARARVIND
    @BENHARARVIND Рік тому

    Brother please help
    If the program detects i want an alarm
    But I don't know what to write i 'if' condition (what will be name of the detected image from the video)

  • @MrTrollificational
    @MrTrollificational Рік тому +1

    Hey Man, thanks for the great vid!
    I'm having issues with my mAP values, they are extremely low. I'm training on a dataset with 70 images and labels. I've run the training model a few times from 100 epochs to 1000 epochs yet still my recall (0.1-0.5) and mAP graphs are very low (between 0.001 and 0.0015). No bounding boxes appear on the test image (on custom object detector run) unless I use an extremely low confidence (0.001). Although a bounding box does appear, it just covers the entire image (not the requested custom object).
    Any ideas what I could do to solve this issue? I would highly appreciate it, Thanks.

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      These many images work for one object. But if there are multiple objects, and that too complex ones, 70 images are too few.
      You can try training yolov7 tiny and see if it improves mAP.

    • @MrTrollificational
      @MrTrollificational Рік тому

      @@TheCodingBug Thanks for the quick reply! I'm training a relatively simple single object. I'll run a training set on my data using the yolov7 tiny model and see if that helps. Thanks for the suggestion my friend!

    • @chaimacham9414
      @chaimacham9414 Рік тому

      @@TheCodingBug can you answer please how to select the best number of images to train with

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      @@chaimacham9414 100 images for 1 object is a good starting point.

    • @chaimacham9414
      @chaimacham9414 Рік тому

      thank you so much for your video it is really really helpful

  • @mustafabahadryaldiz8979
    @mustafabahadryaldiz8979 11 місяців тому

    I couldn't install torchvision and torch. I do the same thing but I got an error. How can I fix this issue?

  • @chaimacham9414
    @chaimacham9414 Рік тому +1

    please if i would use the weights of the first training and run the model another time with more data should i modify in the commande the weight yolov7.pt with best.pt of the privious model and that's it ?

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      Yes. Also, delete labels.cache files in train and val folders before starting training on new data.

    • @chaimacham9414
      @chaimacham9414 Рік тому

      @@TheCodingBug okk thank you so muchh

  • @ravichoudhary2365
    @ravichoudhary2365 Рік тому +1

    Thanks for making this video. I am facing problem in installing "torch==1.11.0+cu113" due to restriction i am not able to solve it , getting SSL error. In my system torch==1.13.0+cu113 is already present but its not working for the code. My model get train for 3 epoch than it shows the "Nvidia driver error". Please suggest something i would be grateful to you.

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Just update the driver.

    • @ravichoudhary2365
      @ravichoudhary2365 Рік тому

      @@TheCodingBug Thanks for replying.
      I already have “Nvidia driver” installed.

    • @ravichoudhary2365
      @ravichoudhary2365 Рік тому

      Is there any requirements of specific torch versions I.e 1.11 or can I use the existing toch of 1.13 version. Which is already available

    • @TheCodingBug
      @TheCodingBug  Рік тому

      @@ravichoudhary2365 Install the latest version.

    • @TheCodingBug
      @TheCodingBug  Рік тому

      @@ravichoudhary2365 Check 5:09

  • @hughmungus8784
    @hughmungus8784 2 роки тому

    I am having trouble with the LabelIMG,I click rec box and then when I try to click anywhere on the image it crashes and gives me this error : line 530, in paintEvent
    p.drawLine(self.prev_point.x(), 0, self.prev_point.x(), self.pixmap.height())
    TypeError: arguments did not match any overloaded call:
    drawLine(self, QLineF): argument 1 has unexpected type 'float'
    drawLine(self, QLine): argument 1 has unexpected type 'float'
    drawLine(self, int, int, int, int): argument 1 has unexpected type 'float'
    drawLine(self, QPoint, QPoint): argument 1 has unexpected type 'float'
    drawLine(self, Union[QPointF, QPoint], Union[QPointF, QPoint]): argument 1 has unexpected type 'float'

    • @hughmungus8784
      @hughmungus8784 2 роки тому +1

      Oh I have python 3.10 installed and not 3.9, trying to follow along with pycharm so its a litel different, will use conda

    • @ljfroche399
      @ljfroche399 Рік тому

      @@hughmungus8784 i fixed it by installing python 3.7

  • @amrzakaria5290
    @amrzakaria5290 Рік тому +2

    I do same as you but no box drawn on the image.

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Use threshold 0.2 instead of 0.5

    • @alejandroguerra6755
      @alejandroguerra6755 Рік тому

      I’m having the same issue. The training occurs, but when I go to the detect folder , there is no box.
      How did you solved this issue ?

    • @amrzakaria5290
      @amrzakaria5290 Рік тому

      pepsi.yaml
      train: ./pepsi/train
      val: ./pepsi/val
      test: ./pepsi/test
      # number of classes
      nc: 1
      # class names
      names: ['pepsi']

    • @alejandroguerra6755
      @alejandroguerra6755 Рік тому

      @@amrzakaria5290 you added pepsi.yaml on the top of the file?
      Is there an issue if I don’t have CUDA ?
      My code works , but it won’t show me any boxes

    • @TheCodingBug
      @TheCodingBug  Рік тому

      See graphs of training. The model isn't learning anything. The values for iou or precision recall curves must be very low. Increase training images.

  • @kashishmahajan4951
    @kashishmahajan4951 11 місяців тому

    I followed this tutorial but after training, there are no bounding boxes appearing in the image. Any idea why is that?

    • @jayeshamalhotra9737
      @jayeshamalhotra9737 11 місяців тому +1

      I am having the same issue......are you able to solve it?

  • @akshu278
    @akshu278 Рік тому

    I am getting this error when i run the final line
    AssertionError: CUDA unavailable, invalid device 0 requested

    • @TheCodingBug
      @TheCodingBug  Рік тому

      You do not have cuda supported GPU. Remove --device parameter.

  • @Xalo7777
    @Xalo7777 Рік тому +1

    Hi there... can we have a conversation about object detection? would love to show you what we are building and to understand how OD can boost our project.

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Hello. Let's connect on Facebook. facebook.com/BugCodingThe

  • @muhammadmarzooq4045
    @muhammadmarzooq4045 Рік тому

    Hey, while the training is running, I'm getting this warning "lr_scheduler.step() before optimizer.step()".... now what should I do?

    • @muhammadmarzooq4045
      @muhammadmarzooq4045 Рік тому

      When I'm trying to run custom object detector on images, the detect file has exp file and when I try to open it, the img is shown but not with any bounding box and it didn't anything

    • @TmpXcraft
      @TmpXcraft Рік тому +1

      same error... should I ignore that?

    • @TheCodingBug
      @TheCodingBug  Рік тому

      Yes

  • @pinhuang4685
    @pinhuang4685 Рік тому

    Following your steps, I successfully ran yolov7, but my val box in the result chart is empty, precision and recall are 0, how to fix it

    • @TheCodingBug
      @TheCodingBug  Рік тому +1

      Add more annotated images or use Google colab and see if it improves.

    • @pinhuang4685
      @pinhuang4685 Рік тому

      @@TheCodingBug Thanks for the reply, I will try your suggestion again

  • @rupalimishra435
    @rupalimishra435 4 місяці тому

    At the time of testing it can not detect any picture and video

  • @indstorm8680
    @indstorm8680 Рік тому +1

    i have doubt like cant we run the same thing in intel laptops because i got an error regarding cuda???

    • @TheCodingBug
      @TheCodingBug  Рік тому

      You can run without cuda on CPU.

    • @indstorm8680
      @indstorm8680 Рік тому

      @@TheCodingBug but isn't it like the project is completely based on cuda ??

    • @TheCodingBug
      @TheCodingBug  Рік тому

      @@indstorm8680 No. It needs cuda and Nvidia GPU for faster training but cpu can also be used for slower training.

  • @feras6471
    @feras6471 2 роки тому

    Thanks

  • @thamba6116
    @thamba6116 11 місяців тому +1

    how to create a empty script as u mentioned in 1:20......?

    • @TheCodingBug
      @TheCodingBug  11 місяців тому

      Create a new text file, rename it with extension .py instead of .txt