Mask R-CNN Practical Implementation

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 355

  • @CodeWithAarohi
    @CodeWithAarohi  8 месяцев назад +4

    This code is tested on Python 3.8.0, tensorflow 2.4.0, keras 2.3.1 and h5py 2.10.0

    • @TechTravel_with_MAC
      @TechTravel_with_MAC 13 дней назад

      I already tried this version but google colab by default take 3.8.20 not 3.8.0
      And then I process this tenserflow and keras version but still I am getting of other requirement version problem which was not working in this version --can u share your env setup

    • @borradurgasree6786
      @borradurgasree6786 11 дней назад

      @@TechTravel_with_MAC
      did you get solution, please share it in comment box

  • @ImtiazAli-fc2fo
    @ImtiazAli-fc2fo 2 месяца назад

    I am in USA and working on imaging. I appreciate you highly. You did a great job. Excellent

  • @sanjayankali7006
    @sanjayankali7006 6 месяцев назад +1

    very neat, clear, and simple explanation.. Keep it up madam

  • @rajatvardam2787
    @rajatvardam2787 2 года назад +1

    Mam your videos are very on-point, easy to understand and implement. Your previous videos helped me as well just like how this video helped me now. You are doing a good work. Thankyou.

  • @DeathlessLife786
    @DeathlessLife786 Год назад +1

    A very clear explanation mam.. Thanks a lot...Live long ....

  • @DeathlessLife786
    @DeathlessLife786 Год назад +1

    Hi Mam, I have completed all steps what u have taught in your tutorial. Actually i want to mask liver from CT image. So I have created two classes for Liver and Spleen using CT image.
    ( The python is installed in C drive anf my project is stored in the path C:\New_project_mask_rcnn)
    Finally i got the following in the output window..........
    objects: ['liver']
    numids [1]
    objects: ['spleen']
    numids [2]
    objects: ['liver']
    numids [1]
    objects: ['liver']
    numids [1]
    Traceback (most recent call last):
    File "C:\New_project_mask_rcnn\custom.py", line 167, in
    dataset_val.load_custom(r'C:\New_project_mask_rcnn\Dataset',"val")
    File "C:\New_project_mask_rcnn\custom.py", line 103, in load_custom
    image = skimage.io.imread(image_path)
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\skimage\io\_io.py", line 48, in imread
    img = call_plugin('imread', fname, plugin=plugin, **plugin_args)
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\skimage\io\manage_plugins.py", line 209, in call_plugin
    return func(*args, **kwargs)
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\skimage\io\_plugins\imageio_plugin.py", line 10, in imread
    return np.asarray(imageio_imread(*args, **kwargs))
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\imageio\core\functions.py", line 159, in imread
    with imopen(uri, "ri", plugin=format) as file:
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\imageio\core\imopen.py", line 161, in imopen
    request = Request(uri, io_mode, format_hint=format_hint)
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\imageio\core
    equest.py", line 248, in __init__
    self._parse_uri(uri)
    File "C:\Users\HP\AppData\Local\Programs\Python\Python36\lib\site-packages\imageio\core
    equest.py", line 388, in _parse_uri
    raise FileNotFoundError("No such file: '%s'" % fn)
    FileNotFoundError: No such file: 'C:\New_project_mask_rcnn\Dataset\val\image1.jpg'
    ------------------------------------------------------------------------------
    In the valitation folder named "val"
    The image1 is a picture stored in Training folder named as "train".
    i donot have stored any image with name image1.
    ------------------------------------------------------------------------------------
    How do solve this issue? Please guide me mam...

  • @student747
    @student747 3 года назад +6

    YOU ARE THE BEST WOMAN IN THE WORLD!)))

  • @rupakdey6753
    @rupakdey6753 3 года назад +5

    The explanation from the previous video and the implementation in this video is too good ❤️. Keep up the good work mam ❤️Try to make videos on Big Data too 😊🙏

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад +1

      Thank you, I will make videos on Big data

  • @senthamilselvirajavel
    @senthamilselvirajavel 4 месяца назад +1

    good evening mam..your teaching is more excellent mam..kindly upload this implementation of mask rcnn in colab platform mam..so that it can very much useful for our students mam...thank you so much for your excellent effort mam..

    • @CodeWithAarohi
      @CodeWithAarohi  4 месяца назад +1

      Hi, Follow this process to run the code in colab. Just paste this entire code folder in your google drive. Then the code which I wrote in custom.py file, paste it in the colab and run. Make sure to select the GPU from notebook settings. Also, make sure to change the paths in custom.py file code when you paste it in colab. You can ask me queries if you face any problems while running on colab.

  • @soravsingla6574
    @soravsingla6574 Год назад

    Wow. Very nicely explained

  • @dariodellamura64
    @dariodellamura64 3 года назад +7

    Hi Aarohi, I have a question to ask: how can the total IOU be calculated for each single class to be predicted? Thanks for your deep learning videos.

  • @anonnymous3440
    @anonnymous3440 2 года назад

    Amazing explaination. Super helpful; thank you!

  • @bayualiffarisqi3251
    @bayualiffarisqi3251 2 года назад +2

    hai ma'am i have error in may program after training, the error like this
    UnboundLocalError: local variable 'image_id' referenced before assignment

  • @laurangome5016
    @laurangome5016 3 года назад

    thank you so much you dont how much you are helping me right now God bless you

  • @alakanandamishra4242
    @alakanandamishra4242 2 года назад +1

    Thanks Mam for your valuable guidance. I have few queries: 1. I have implemented it as per your steps but test performance is very poor. What should be the training strategy for improved performance? 2. Min. Epochs required on COlab?. How can I run on video?

  • @pavaramanupriya4457
    @pavaramanupriya4457 3 года назад

    Thank you so much❤ This video helps me a lot to complete my research.

  • @chun-julee6942
    @chun-julee6942 3 года назад

    Great job, Ma'am!!

  • @themlexpert_
    @themlexpert_ Год назад

    This is a great video illustrating the MRCNN implementation. Currently, im working on a project and im trying to visualize the top masks of random images in my training dataset and the top masks are showing distortion. I went back a few steps to print out the masks in from the for loop of image_ids and i got a bunch of arrays of false as output. Im not sure why im getting false as output.

  • @unggulprabowo1045
    @unggulprabowo1045 3 года назад

    Amazing sis

  • @ApekshaAlavandi
    @ApekshaAlavandi 2 месяца назад +1

    i want to train Mask-RCNN on python 3.9.7 ..please can you share the requirements.txt?

  • @prodbyryshy
    @prodbyryshy 10 месяцев назад

    i might need to implement mask r cnn for 3D image stacks, havent found any good implementations yet, was wondering how hard it would be to achieve this

  • @juanej7
    @juanej7 3 года назад

    You're amazing 👏, thank you!

  • @MSCAIMLRBRITHANYA
    @MSCAIMLRBRITHANYA Год назад

    mam what if i have different json file from each images? how do i train a mask rcnn

  • @ainulhakimbinfizalsabillah4011
    @ainulhakimbinfizalsabillah4011 2 года назад +1

    Hi, Madam. That is very informative knowledge to learn step by step using mask rcnn. I wonder, how can i continue or extend the learning epoch. I have following your step but making some adjustment with my own dataset and about 50 epochs. but my result is not fulfill, so i want to extend the training but does not want to start over because my training will take about 6-7 hours. so can you guide me? thanks.

  • @andianzanulzikra5729
    @andianzanulzikra5729 Год назад

    how to display matrix, and accuracy?

  • @biplabdas8635
    @biplabdas8635 Год назад

    Ma'am can you tell us where we need to see accuracy in the training

  • @tech4tomorrow
    @tech4tomorrow Год назад

    mam how one can get the train data as images rather than json file. and if I want to add some new classes example glass then how it is possible plz make video on that.

  • @dr.sanjayankali3410
    @dr.sanjayankali3410 6 месяцев назад

    Thank you mam.. But if I keep different images then during inference mode it shows run time error about as image not found

    • @dr.sanjayankali3410
      @dr.sanjayankali3410 6 месяцев назад

      It works fine only if there are same images in train and Val folder madam

  • @Wisemonk24
    @Wisemonk24 2 года назад

    indebted to you maam .

  • @Sandhya_Bytes
    @Sandhya_Bytes 8 месяцев назад

    Mam in which file i have to perform preprocessing techniques mam Please reply mam??

  • @captainofthewhitetower
    @captainofthewhitetower 5 месяцев назад

    How can we show this on like Vscode using python?

  • @fobaogunkeye3551
    @fobaogunkeye3551 2 года назад

    Thanks for the video tutorial! However, you didn't put the link to the pre-trained weights. How can I get it?

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад

      github.com/matterport/Mask_RCNN/releases/download/v2.0/mask_rcnn_coco.h5

    • @fobaogunkeye3551
      @fobaogunkeye3551 2 года назад

      @@CodeWithAarohi Thank you. I've been getting an error coming from the load_mask function. Please how do I solve this?
      IndexError: index 1280 is out of bounds for axis 1 with size 1280

  • @salmanahmed3938
    @salmanahmed3938 Год назад

    please make the video on the HAM10000 dataset for skin lesion that how to import this dataset and use it.

  • @eliot2884
    @eliot2884 6 месяцев назад

    Thanks for the share, but I have a remark
    On this lines :
    "assert subset in ["train", "val"]
    dataset_dir = os.path.join(dataset_dir, subset)

    annotations1 = json.load(open('D:\\env_with_tensorflow1.14\\all_maskrcnn\\maskrcnn_truck_car\\Dataset\\train\\train_json.json'))"
    The dataset dir end with '\train' or '\val' but on your 'annotations1' there is only the path to 'train' subset.
    The problem is that when the subset will be 'val' the image_path = os.path.join(dataset_dir, a['filename']) on line 95 will be incorrect because a['filename'] access to the file names of the train json image and not the val image.
    So if the filename is image_train.jpg the path would be ''...\\Dataset\\val\\image_train.jpg" but on the val_json there is not train image but only "v1","v2" so there will be an error. So its necessary to change the path of the annotations1 according to the subset.

  • @angelospapadopoulos7679
    @angelospapadopoulos7679 2 года назад

    on the mean average precision i get this error:
    AttributeError: module 'utils' has no attribute 'gt_pred_lists'
    even though the utils has this attribute, i don't get it!

  • @devendrakoribilli7441
    @devendrakoribilli7441 Год назад

    Mam !!! how many images should be trained to get an accurate object detection output to detect grapes?

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад +1

      The number of images required to train an accurate object detection model for grapes can vary depending on several factors such as the complexity of the grape images, the number of classes to be detected (e.g., green grapes, red grapes), the quality of the images, and the desired level of accuracy.
      In general, a good rule of thumb is to have at least 400-500 hundred training images

  • @nikitamohod7971
    @nikitamohod7971 2 года назад

    Hello mam
    You explain the concept of MRCNN so good,
    It's my request to you plz give the demo of same mask rcnn on any video file.

  • @sushantparajuli611
    @sushantparajuli611 2 месяца назад

    Why did you copy the same datasets in both folders; train and val? Is this a correct approach? Could you give some insights? In my opinion, we should split the datasets into train and validation. Or?

    • @CodeWithAarohi
      @CodeWithAarohi  2 месяца назад +1

      You need to put the different set of images in train, val and test.

  • @vishalpahuja2967
    @vishalpahuja2967 Год назад

    for setting enviornment can you provide specifications you have used.
    Thank you.

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      python 3.6.8, tensorflow 1.14.0, keras 2.3.0, h5py version 2.10.0

  • @mrfusion_ad
    @mrfusion_ad Год назад

    Mem one error occurred during execution of train(model) the
    AttributeError: SGD' object has no attribut
    How to resolve the issue

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      please provide additional context and code related to the error you are encountering

  • @altafsarfraz526
    @altafsarfraz526 2 года назад

    Thanks a lot ma'am for your guidance.
    Ma'am in your test_truck_car_model.ipynb notebook.... Is the Confusion matrix code In the last cell working correctly?

  • @harinderkaur8320
    @harinderkaur8320 3 года назад

    It is showing warning: you are using default load mask(),may be you need to define your own one...repeatedly..plz help

  • @RanjaniAnbalagan-nl4gu
    @RanjaniAnbalagan-nl4gu 4 месяца назад

    mam the object that i wanted to detect is not there in pretrained models in that case,how would i get cocoweights?.should i necessarily use coco weights? what would i do otherwise?
    pls guide mam

    • @CodeWithAarohi
      @CodeWithAarohi  4 месяца назад +1

      If the object you want to detect is not in pretrained weights then collect images related to your custom object, annotate those images in the format which Mask R-CNN accepts. Then train your model on that custom dataset.
      You can train in 2 ways-
      1- Train the model from scratch.
      2- Use pretrained model and then fine tune it with you custom dataset.

    • @RanjaniAnbalagan-nl4gu
      @RanjaniAnbalagan-nl4gu 4 месяца назад

      Thankyou mam for your concern to take time and reply.one more doubt mam,can i annotate objects after zooming it,,will it cause any performance variation when i use that model in online..can you please tag video on training a model from scratch using mask rcnn.

  • @farellfahroziofficial
    @farellfahroziofficial 2 года назад +1

    hiii mam, My Proggram AttributeError: module 'keras.engine' has no attribute 'Layer' , can you please help me mam?

  • @fredbaafi9013
    @fredbaafi9013 Год назад

    Hi Aarohi, that's a very good explanation, but how do you count the class when you want to detect a car and a number plate? Should one call car as class 1 and number plate as class 2?

  • @aminmemar416
    @aminmemar416 Год назад

    Does mask rcnn supports binary mask as training in json file?

  • @saadsalmanresearchassociat674
    @saadsalmanresearchassociat674 2 года назад +1

    First of all, thanks for an amazing tutorial. Secondly, when I run the file, I get this error: FileNotFoundError: No such file: 'C:\Users\Saad Salman\Desktop\Mask-RCNN\Dataset\val\angry.8affb600-fe31-11ec-bcdd-b46bfc8af0c1.jpg'. However, this file is in the training folder. I dont know why is it searching for it in the val folder

    • @AnumFatima427
      @AnumFatima427 2 года назад

      I'm facing the same issue

    • @saadsalmanresearchassociat674
      @saadsalmanresearchassociat674 2 года назад

      @@AnumFatima427 I pasted a comment referring to a blog that uses Mask RCNN, which was deleted, I don't know why. Using the code from that I solved this issue in my implementation.

    • @saadsalmanresearchassociat674
      @saadsalmanresearchassociat674 2 года назад

      @@AnumFatima427 I think I cant post links to blogs here.

    • @AnumFatima427
      @AnumFatima427 2 года назад +1

      I found a solution from comments and it worked for me,
      1. Place Json file in val and train folder with "same name"
      2. Give json file path like this:
      annotations=json.load(open(os.path.join(dataset_dir, 'Json file name')))

  • @PremKumar-zb8gt
    @PremKumar-zb8gt Год назад

    if you get long data set how to validation

  • @richasharma5949
    @richasharma5949 2 года назад +1

    I am getting the following error:
    File "custom.py", line 77, in load_custom
    annotations = [a for a in annotations if a['regions']]
    File "custom.py", line 77, in
    annotations = [a for a in annotations if a['regions']]
    TypeError: list indices must be integers or slices, not str

    • @THEULTIMATEPRASHANT
      @THEULTIMATEPRASHANT 2 года назад

      same error, u got any solution?

    • @eyeris5812
      @eyeris5812 2 года назад

      @@THEULTIMATEPRASHANT have you found a solution yet?

    • @THEULTIMATEPRASHANT
      @THEULTIMATEPRASHANT 2 года назад +1

      @@eyeris5812 yes you need to change it to str.. where it accepts as int… it’s mid night in my region and Saturday too.. i will reply in detail on monday

    • @eyeris5812
      @eyeris5812 2 года назад +1

      @@THEULTIMATEPRASHANT Bhai, we might be from the same region, thank you though!

    • @chanchan6312
      @chanchan6312 Год назад

      @@THEULTIMATEPRASHANT how to correct this? Plz help if you know how, thank you so much

  • @MuhammadRashid-hu3wo
    @MuhammadRashid-hu3wo Год назад

    Hi Arohi, Can you please tell me which Python, tensorflow and keras version you used?

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      Here, I have used tensorflow 1.x but if you want to work with tensorflow 2.x then check this video: ruclips.net/video/QP9Nl-nw890/видео.html

  • @arnavthakur5409
    @arnavthakur5409 9 месяцев назад

    Best RUclips channel / Platform to learn Artificial Intelligence , Data Science , Data Analysis , Machine Learning.
    #BestChannel #RUclipsChannel #ArtificialIntelligence #CodeWithAarohi #DataScience #Engineering #MachineLearning #DataAnalysis #BestLearning #LearnDataScience #DataScienceCourse #AytificialIntelligenceCourse #Codewithaarohi #CodeWithAarohi Code with Aarohi

  • @gayathrit.v8844
    @gayathrit.v8844 8 месяцев назад

    what are version used for tensorflow and keras

    • @CodeWithAarohi
      @CodeWithAarohi  8 месяцев назад

      This code is tested on Python 3.8.0, tensorflow 2.4.0, keras 2.3.1 and h5py 2.10.0

  • @BHAUKALEXPERIMENT
    @BHAUKALEXPERIMENT 11 месяцев назад

    when i run this then keras.engine not found erorrs acurs my tensorflow is 2. version and python is 3.11

    • @CodeWithAarohi
      @CodeWithAarohi  11 месяцев назад

      Use oython 3.6.8 and tensorflow 1.14

  • @rigvedsanku5128
    @rigvedsanku5128 3 года назад

    Arohi ji, thank yiu for the explaination...
    How do we proceed if we already have the masked images as our target ?

  • @namalnshashi923
    @namalnshashi923 3 года назад

    Hi, You have given the path to json file of annotation info of training data but json file for validation data is not given. I faced this error and passed separate json files for train and validation data. Now it starts to train Epoch 1 but I cannot see CPU or GPU consumption. Please help.

    • @amnasiddiqui1017
      @amnasiddiqui1017 2 года назад

      how to pass separate json file for validation data?

  • @Aditya-hb8eo
    @Aditya-hb8eo 2 месяца назад

    i am having python 3.8.0 but many errors are coming due to different version compatiblity , can you give what all versions are required for each library

    • @CodeWithAarohi
      @CodeWithAarohi  2 месяца назад

      Follow this video: ruclips.net/video/QP9Nl-nw890/видео.html and This code is tested on python 3.8.0, tensorflow 2.4.0 and keras 2.3.1

  • @subhajitrakshit9866
    @subhajitrakshit9866 3 года назад

    Hi Aarohi, many thanks for the explanation..one thing--> why we need to choose latest epoch? may be your 2nd last epoch or some epoch in middle could give you min loss value compare to all others right??

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      Hi, you can choose any weight file as per model performance

  • @deeplearningwithfawadsalam4762

    Hi mam, I want to know how can we compute the feature map of mask rcnn? Any code or help you can give.thanks

  • @gowithgaurav9617
    @gowithgaurav9617 Год назад

    Hello ma'am,
    You have explained really well but when we do data augmentation for example flip,or rotate than our original annotations position will also be changed? For example if I annotate a building which is on right side than if we do augmentation of flip than the building will be augmented on left side does the annotation also change its position?how does it work? Please explain

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад +1

      You can do this : # model.train(dataset_train, dataset_val,
      # learning_rate=config.LEARNING_RATE,
      # epochs=600,
      # layers='heads', #layers='all',
      # augmentation = imgaug.augmenters.Sequential([
      # imgaug.augmenters.Fliplr(1),
      # imgaug.augmenters.Flipud(1),
      # imgaug.augmenters.Affine(rotate=(-45, 45)),
      # imgaug.augmenters.Affine(rotate=(-90, 90)),
      # imgaug.augmenters.Affine(scale=(0.5, 1.5)),
      # imgaug.augmenters.Crop(px=(0, 10)),
      # imgaug.augmenters.Grayscale(alpha=(0.0, 1.0)),
      # imgaug.augmenters.AddToHueAndSaturation((-20, 20)), # change hue and saturation
      # imgaug.augmenters.Add((-10, 10), per_channel=0.5), # change brightness of images (by -10 to 10 of original value)
      # imgaug.augmenters.Invert(0.05, per_channel=True), # invert color channels
      # imgaug.augmenters.Sharpen(alpha=(0, 1.0), lightness=(0.75, 1.5)), # sharpen images
      # ]
      # ))

    • @gowithgaurav9617
      @gowithgaurav9617 Год назад

      @@CodeWithAarohi yes this I know but what I am actually asking is what about the annotation i.e the mask?When for example an image is fliped, will the ground truth polygon from the json file i.e the cordinates for the particular instance in the image also fliped? Because if the image is fliped, then the instance is in another position, right?how to do this? I would appreciate your answer.

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      Mask R-CNN does not automatically handle updating the annotations when applying transformations to the images. We have to do it manually.
      Detectron2 or TensorFlow's Object Detection API, provide functionalities for data augmentation and automatically handle updating the annotations when applying transformations to the images.
      Below is an example of a custom Python code that uses the popular library imgaug for image augmentation and creates new annotations for the corresponding augmented images in the context of Mask R-CNN.
      pip install imgaug
      import imgaug.augmenters as iaa
      import numpy as np
      import cv2
      # Function to apply horizontal flipping to the image and annotations
      def flip_image_and_annotations(image, bounding_boxes, segmentation_masks):
      # Create an augmenter for horizontal flipping
      flipper = iaa.Fliplr(1.0)
      # Apply the flip augmentation to the image
      flipped_image = flipper.augment_image(image)
      # Get image width for calculating new bounding box coordinates
      image_width = image.shape[1]
      # Flip bounding boxes
      flipped_bounding_boxes = []
      for box in bounding_boxes:
      x_min, y_min, x_max, y_max = box
      x_min_flipped, x_max_flipped = image_width - x_max, image_width - x_min
      flipped_bounding_boxes.append([x_min_flipped, y_min, x_max_flipped, y_max])
      # Flip segmentation masks
      flipped_segmentation_masks = []
      for mask in segmentation_masks:
      # Assuming segmentation masks are binary (0 for background, 1 for object)
      flipped_mask = np.fliplr(mask)
      flipped_segmentation_masks.append(flipped_mask)
      return flipped_image, flipped_bounding_boxes, flipped_segmentation_masks
      # Example usage
      if __name__ == "__main__":
      # Load the original image, bounding boxes, and segmentation masks
      original_image = cv2.imread("path_to_original_image.jpg")
      original_bounding_boxes = [[50, 100, 150, 200]] # Example format: [x_min, y_min, x_max, y_max]
      original_segmentation_masks = [np.ones((original_image.shape[0], original_image.shape[1]))]
      # Apply augmentation and get augmented image, bounding boxes, and masks
      augmented_image, augmented_bounding_boxes, augmented_segmentation_masks = flip_image_and_annotations(
      original_image, original_bounding_boxes, original_segmentation_masks
      )
      # Save the augmented image and annotations or use them for training Mask R-CNN
      cv2.imwrite("path_to_save_augmented_image.jpg", augmented_image)
      print("Augmented Bounding Boxes:", augmented_bounding_boxes)
      print("Augmented Segmentation Masks:", augmented_segmentation_masks)
      In this example, we used imgaug to implement horizontal flipping. You can similarly add other augmentation techniques or combine multiple augmenters from the imgaug library to perform a wide range of data augmentation.

  • @fahadulislam863
    @fahadulislam863 2 года назад

    Can you please mention the versions u use?

  • @shimajafari5590
    @shimajafari5590 Месяц назад

    hi, thank you for your helpful video; i jae a question , hope you can give me a guide.
    i tried to apply this code, first it was the problem of tensorflow 1x version not being abled in colab, then i made a virtual env using lower python version and using tensorflow 1x , it appeared with other errors such as skimage and code being old!
    i wish you have sth for me to do it,,,
    the other help that i want is about models detecting polygon with polygon annotations;
    i want to detect polygon lables exactly as polygons, not as bounding boxes (when the model detect my thing, it shows it as a polygon label not a bounding box label), do you have any clue for me? or do you know on which models should i work? i'll be so thankful anyway💕💕

    • @CodeWithAarohi
      @CodeWithAarohi  Месяц назад

      You can perform instance segmentation with other models also like YOLO11. Here is a tutorial: ruclips.net/video/SwG9BSWIpBs/видео.html

  • @prashanthabib452
    @prashanthabib452 2 года назад

    Hello Mam,
    Thanks for your good explanation and detailed video.
    One doubt here : is it necessary that the number of images in the train and val folders be same ? Or in the JSON file?
    As the "annotations" variable is calculating nubmer of indexes from the train.json file. And i am also getting the error for the same saying that , val.json cannot find some files when number of images are different in train and val folder. However when i careful checked in your video that is not the case. Thanks.

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад

      Number of images can be different in train and val folder. Just have the json file of train and val folder with a same name then use if else condition to read train and val json file

  • @puranjitsingh1782
    @puranjitsingh1782 3 года назад

    Can we use latest version of tensorflow for this MaskRCNN execution

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      This code will work with older version but if you want to use it with tensorflow 2 then you need to make changes in the code

  • @nasimthander1296
    @nasimthander1296 3 года назад

    Here you are using .h5 for model file, will the code be same for the .pkl model file? If not please help me to counter this problem.

  • @biplabdas8635
    @biplabdas8635 Год назад

    Ma'am my training has run successfully but during testing when we take random image the box is not appearing and it is appearing in the whole image so ma'am can you suggest me what I need to do now

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      I need more details like how many classes you are working upon? How many images per class you have etc. Mail me all your project details at aarohisisngla1987@gmail.com

  • @DeathlessLife786
    @DeathlessLife786 Год назад

    Do i want to generate separate coco weight file for different images like CT, MRI..etc..?

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      You need a single json file for all your training images. Ans there can be more than 1 class in your training dataset.

  • @sanjayankali7006
    @sanjayankali7006 6 месяцев назад

    one doubt madam, while training the maskrcnn, we have to have same images in train and val folder or different?

    • @CodeWithAarohi
      @CodeWithAarohi  6 месяцев назад

      different images for training and validation

  • @darkdk20
    @darkdk20 2 года назад

    My Epoch has be running from 1/20 for pass 5-6 hrs and it could not run till 20/20, i not sure whats the problem

    • @sean9734
      @sean9734 2 года назад

      same, did you solve this?

  • @salmabo3809
    @salmabo3809 3 года назад

    Hi Aarohi, please can you tell me what the tensorflow and keras version you used?

  • @esotericwanderer6473
    @esotericwanderer6473 3 года назад

    Great job ma'am!!
    can u plz do project on face mask detection?

  • @kishore3785
    @kishore3785 3 года назад +1

    AttributeError: module 'keras.engine' has no attribute 'Layer' can you please help me mam

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      Are you running this code on tensorflow 1.14 and keras 2.2.5 ?

    • @madanparajuli9080
      @madanparajuli9080 3 года назад

      @@CodeWithAarohi After running on Tensorflow 1.14 and keras 2.2.5, I am still experiencing another error AttributrError: 'Node' object has no attribute 'output_masks'

    • @shreejalmaharjan2001
      @shreejalmaharjan2001 3 года назад

      @@CodeWithAarohi I am facing the same problem too.

  • @onewhoflutters4866
    @onewhoflutters4866 5 месяцев назад

    Hi, How can I change the python version to 3.8.0 in google colab?

    • @CodeWithAarohi
      @CodeWithAarohi  5 месяцев назад +1

      Try these commands:
      !sudo apt-get update -y
      !sudo apt-get install python3.8
      !sudo apt-get install python3.8-dev
      !sudo apt-get install python3.8-venv

  • @Sandhya_Bytes
    @Sandhya_Bytes 8 месяцев назад

    Mam is there a necessary to do any preprocessing for images if yes in which file I have to do them please reply for this mam

  • @developerr4001
    @developerr4001 3 года назад +1

    Hi Aarohi maam, I have two classes for which I followed your tutorials on RCNN. I am getting an error:
    raise FileNotFoundError("No such file: '%s'" % fn)
    FileNotFoundError: No such file: '/Users/r/Desktop/mrcnn/dataset/val/checkbox_on_1.jpg'
    In my dataset, I have 66 training data (for 2 classes) and 09 validation data. At the time of execution, the program gives the error. The file, program is looking for, is in the training folder. But it searches for that particular file in the validation folder as well. "checkbox_on_1.jpg' file is only in the train folder, not sure why it is also asking for the same file in tge val folder? How can I solve this?

    • @shabirahmed6510
      @shabirahmed6510 3 года назад +2

      Hello I had the same problem , just change your subset = "train" and comment these lines
      # Train or validation dataset?
      #assert subset in ["train", "val"]
      dataset_dir = os.path.join(dataset_dir, "train")

    • @shabirahmed6510
      @shabirahmed6510 3 года назад

      this happens because the model is taking val folder always so we just set the subset to train

    • @ritusingh6855
      @ritusingh6855 3 года назад

      @@shabirahmed6510 how do we resolve this?? I am getting the same error, the images from the train folder is getting checked in the val folder.

    • @ritusingh6855
      @ritusingh6855 3 года назад

      Try this
      annotations1 = json.load(open(os.path.join(dataset_dir, 'wee_paddy.json')))
      keep the name of the json files in the both train and val folders

    • @rafif6617
      @rafif6617 2 года назад

      i had the same issue, anyone solve this? its like annotations for train applied to the val??

  • @malusisibiya3330
    @malusisibiya3330 2 года назад

    Does this work with tensorflow 2.x. I noticed that in your directory the active version of tensorflow is 1.14?

  • @arunkumarsinghmitsgwalior13
    @arunkumarsinghmitsgwalior13 2 года назад

    Very nice Aarohi, Pls can you the how to setup the env and necessary pakages and requirement.txt

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад +1

      python==3.6.8 , tensorflow==1.15.0 , Keras==2.2.4 , h5py==2.10.0

  • @waleedabu-khader5367
    @waleedabu-khader5367 2 года назад

    Thanks great work
    How did you create a separate environment? And my PC doesn’t have a dedicated GPU how can i run the training this way?
    How did you launch the test model file on jupyter notebook? I downloaded the file but I can’t open it!
    Kindly help!

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад

      You can set GPU_COUNT in config.py file which is in mrcnn folder . And use tensorflow instead of tensorflow-gpu

  • @BhajansAshwin
    @BhajansAshwin 3 года назад +1

    Thanks!

  • @devavratpro7061
    @devavratpro7061 Год назад

    Ma'am, tensorflow 1.x has been unsupported by Colab. Will it run on tensorflow 2???

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад +1

      This code is compatible with tensorflow 1.x. You can downgrade the pip version of colab and then you can install the tensorflow 1.x

    • @devavratpro7061
      @devavratpro7061 Год назад

      @@CodeWithAarohi I tried but it is suggesting to update the code on tensorflow 2. Can you please upgrde your code? Thanks in advance.

  • @prudhvinarayana5331
    @prudhvinarayana5331 Год назад

    Hi Aarohi,i am unable to download the class-descriptions-boxable.csv file, train-annotations-bbox.csv file from the command
    Can u please help me to fix it?

  • @nailashah6918
    @nailashah6918 3 года назад

    Hi Arohi ji
    I want to ask one thing: If we are annotating images using vgg annotator.It seems applicable for train set images but why to annotate validation set using vgg annotator?It should be now a task of mask rcnn to identify objects and apply mask

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      Hello...Training set is used to train the model. We annotate val data because Validation data is used for regularization. It also helps in avoiding the problem of overfitting. It basically estimates the prediction error. Test data is used to evaluate model.

  • @datasciencewitharbaaz5221
    @datasciencewitharbaaz5221 2 года назад

    Which tensorflow and keras version are you using for this particular project, because I am getting problems with versions of tf and keras.

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад +1

      tensorflow 1.15, keras 2.2.5, h5py 2.10.0

    • @datasciencewitharbaaz5221
      @datasciencewitharbaaz5221 2 года назад +2

      @@CodeWithAarohi Thank you mam. and can you please tell us the python version as well.

  • @hunteryarbro
    @hunteryarbro 2 года назад

    Where is the log folder and files coming from?

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад

      Log folder will get created when training starts and you will get your trained models in this folder after every epoch.

  • @madanparajuli9080
    @madanparajuli9080 3 года назад +1

    Hi Ma'am, can you provide us the version of tensorflow, keras and python you used for successfully running this code? I did the exact same thing as you mentioned in this video but I am having a error called "ValueError: Tried to covert 'shape' to a tensor and failed. Error: None values not supported."

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      I am not sure why are you getting this error. I have to see the code

    • @bolzanoitaly8360
      @bolzanoitaly8360 2 года назад

      pip install tensorflow == 1.14.0

  • @sravanmudiraj677
    @sravanmudiraj677 2 года назад

    I got data of 30k. what should i do?

  • @puranjitsingh1782
    @puranjitsingh1782 3 года назад

    I am using Labelme annotation tool to annotate the images to prepare a .json file. I am having a problem in the loop (for a in annotations), can you guide what could be done??

    • @puranjitsingh1782
      @puranjitsingh1782 3 года назад

      It is storing the content in .json file in a different way than how VGG annotator saves a .json file

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      annotation should be in coco format using polygon shape

    • @bhatiapkaur
      @bhatiapkaur 2 года назад

      @@puranjitsingh1782 i have used plain sight annotation tool for large dataset, but facing same problem with .json format, any suggestions?

    • @puranjitsingh1782
      @puranjitsingh1782 2 года назад

      @@bhatiapkaur No idea, I was using labelme annotation toll earlier for data labelling, but now have shifted to CVAT Annotation tool and its the best annotation tool I have used so far. I was preparing a model based on using Mask-RCNN earlier but now am working on developing a model using U-Net architecture

  • @abdullahalnakib5150
    @abdullahalnakib5150 3 года назад

    Your videos are awesome.
    Ma'am, I will be really grateful if you make a video about how to set up the environment to run this MaskRCNN with a GPU of nvidia 30 series, Thank you.

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      Process is similar as we do for other GPU's

  • @dharshinimohan2999
    @dharshinimohan2999 Год назад

    Hello mam!!
    First of all thankyou soo much for the wonderful explanation!!
    Google colab actually doesnt support older tensorflow 1.x versions anymore , So the code shows a lot of errors..
    Can you please give us the upgraded code!!
    We have a deadline to complete our project mam..
    Thanks in advance :)

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      ruclips.net/video/QP9Nl-nw890/видео.html

  • @manoharnookala4212
    @manoharnookala4212 3 года назад

    Hi Arohi, at 5:53 minutes, you told we need draw line on object. if i have 1 lac images then do i need to mask all the images or else only for few?

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      Yes you have to do annotations for all the images

    • @manoharnookala4212
      @manoharnookala4212 3 года назад +1

      @@CodeWithAarohi Then how it works in the live video??

    • @sangavisivanandham2737
      @sangavisivanandham2737 3 года назад

      @@manoharnookala4212 same doubt ... how we can annotate n number of files??

    • @bhatiapkaur
      @bhatiapkaur 2 года назад

      @@sangavisivanandham2737 have you got any solution to this, if i have a large dataset then how to do annotations for all images?

  • @SiddharthaBhaskaran
    @SiddharthaBhaskaran Год назад

    the epoch is taking too long any fix for this ??? please reply mam

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      Adjust the batch size. Smaller batch sizes may lead to faster training per epoch. And you can also adjust the learning rate. A learning rate that is too high may cause the model to converge slowly or not at all, while a learning rate that is too low may slow down convergence. Experiment with different learning rates to find an optimal value.

  • @rafif6617
    @rafif6617 2 года назад

    Hi Aarohi, i have a question. so, from this line:
    annotations1 = json.load(open('D:\\env_with_tensorflow1.14\\all_maskrcnn\\maskrcnn_truck_car\\Dataset\\train\\train_json.json'))
    my understanding is that we only use the training annotations. so how do we us the val annotations? or when? because I didn't see it called.
    Thank you

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад

      You can use if else statement and can call train.json from train and val folder.

  • @yesidospitia8990
    @yesidospitia8990 2 года назад

    Hi, somebody had this error when trying to train the model: "TypeError: cannot pickle 'generator' object ForkingPickler(file, protocol).dump(obj)". I also have this warning "WARNING:tensorflow:Model failed to serialize as JSON. Ignoring... cannot pickle '_thread.RLock'". Thank you a lot.

  • @rzoo1531
    @rzoo1531 2 года назад

    I'm using anaconda to run the program, and I have library and module compatibility issue, is there any reference on what libraries this mask-rcnn run on?

    • @CodeWithAarohi
      @CodeWithAarohi  2 года назад

      What is the issue you are facing?

    • @rzoo1531
      @rzoo1531 2 года назад

      @@CodeWithAarohi Hi thank you for replying, I still haven't solved it. The compatibility problem occurred usually when my TensorFlow, scikit, OpenCV, etc don't match the version that the code is importing and it keep crashing every time I tried to lower the version. So maybe you can share your environment set up like what version of python, TensorFlow, scikit or anything that needed to be installed on your virtual environment

    • @rzoo1531
      @rzoo1531 2 года назад

      @@CodeWithAarohi Also I do notice that there is requirement.txt but there is still some incompatibility with the present update and some are not detailed with what version should be used

  • @waleedak6164
    @waleedak6164 2 года назад

    I don't have a GPU on my PC, can you share a video that runs on google Colab?

  • @sameera3017
    @sameera3017 8 месяцев назад

    Di can you please update a requirement file , which has every installation version required

    • @CodeWithAarohi
      @CodeWithAarohi  8 месяцев назад +1

      I have pasted a new requirements.txt file with a name of requirements_new.txt github.com/AarohiSingla/Plant-Disease-Detection-Using-Mask-R-CNN

    • @sameera3017
      @sameera3017 8 месяцев назад

      Thanks a lot Di@@CodeWithAarohi

    • @CodeWithAarohi
      @CodeWithAarohi  8 месяцев назад +1

      Welcome@@sameera3017

  • @subbusainagesh9788
    @subbusainagesh9788 2 года назад

    Hi Aarohi, Is it possible to use the model on only CPU

  • @deepalisharma1327
    @deepalisharma1327 3 года назад

    Mam, I am running the code on MacOS and now getting any file generated under logs folder. Instead, I am getting warning as : I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA. Could you please suggest?

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      you can ignore the warning. Warning will stop your code processing

    • @deepalisharma1327
      @deepalisharma1327 3 года назад

      @@CodeWithAarohi I was able to solve the issue. I am not getting any errors but model files are also not getting created under logs folder.

  • @Lucas-nw7lj
    @Lucas-nw7lj 3 года назад

    Thank you for your explanation. I'm executing the test_truck_car_model.ipynb with own datasets. When I want to perform the prediction, which predict images which are not present in dataset, the result showed "No instances to display". Do you have any idea about this error?

    • @CodeWithAarohi
      @CodeWithAarohi  3 года назад

      "No instances to display" means objects are not detected. You need to improve your model. Try to increase dataset , epochs

    • @Lucas-nw7lj
      @Lucas-nw7lj 3 года назад +1

      @@CodeWithAarohi thanks so much for replying

  • @adrianrs79
    @adrianrs79 Год назад

    Images must have the same size? thanks madam

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад +1

      In Mask R-CNN, it's generally a good practice to resize your input data to a consistent size before performing annotation and training. This helps ensure that the data is processed uniformly and simplifies the training process.

    • @adrianrs79
      @adrianrs79 Год назад

      Thanks a lot for your answer @@CodeWithAarohi

  • @biswajitroy-zp6lk
    @biswajitroy-zp6lk Год назад

    Is it mandatory that we have to annotate with VIA

    • @CodeWithAarohi
      @CodeWithAarohi  Год назад

      No, it is not mandatory to use the VIA tool for annotating images if you are annotating for Mask R-CNN. There are several other tools available that can be used for image annotation, such as labelImg, RectLabel, and COCO Annotator