Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object detection notebooks update #10351

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

amrzv
Copy link

@amrzv amrzv commented Nov 7, 2021

Description

Hi.
Made changes into reseach/object_detection/colab_tutorials notebooks. Everything tested in default colab environment.
UPDATE: fixed broken links in object_detection repo

context_rcnn_tutorial.ipynb:

  • remove unnecessary installation;
  • fix object_detection package installation.

convert_odt_model_to_TFLite.ipynb, deepmac_colab.ipynb:

  • removed unused imports.

eager_few_shot_od_training_tf2_colab.ipynb:

  • change the installation order (otherwise was error after object_detection package installation).
  • removed unused imports;
  • added f-strings.

generate_ssd_anchor_box_aspect_ratios_using_k_means_clustering.ipynb:

  • made installation clear and the same as in other notebooks.

inference_from_saved_model_tf2_colab.ipynb:

object_detection_tutorial.ipynb:

Type of change

For a new feature or function, please create an issue first to discuss it
with us before submitting a pull request.

Note: Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation update
  • TensorFlow 2 migration
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • A new research paper code implementation
  • Other (Specify)

Tests

Test Configuration: default colab environment, "run all"

Checklist

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@google-cla google-cla bot added the cla: yes label Nov 7, 2021
@Petros626
Copy link

@amrzv Hey,
Can I ask you something about the: generate_ssd_anchor_box_aspect_ratios_using_k_means_clustering.ipynb Tutorial?

@amrzv
Copy link
Author

amrzv commented Jun 10, 2022

@amrzv Hey, Can I ask you something about the: generate_ssd_anchor_box_aspect_ratios_using_k_means_clustering.ipynb Tutorial?

Yes, sure, I will try to help.

@amrzv
Copy link
Author

amrzv commented Jun 24, 2022

Hi.
Can anyone @jch1, @pkulzc, @tombstone pls review this pr?

@Petros626
Copy link

@amrzv Hey, Can I ask you something about the: generate_ssd_anchor_box_aspect_ratios_using_k_means_clustering.ipynb Tutorial?

Yes, sure, I will try to help.

Sorry I was ill and couldn't answer. So my question is about the use of ssd custom anchor tutorial with TF1, because the scripts given on the actual tutorial are for TF2 and I searched the right files in the TF OB API.

So replacing them in the original tutorial should work or not?

@amrzv
Copy link
Author

amrzv commented Jun 25, 2022

@amrzv Hey, Can I ask you something about the: generate_ssd_anchor_box_aspect_ratios_using_k_means_clustering.ipynb Tutorial?

Yes, sure, I will try to help.

Sorry I was ill and couldn't answer. So my question is about the use of ssd custom anchor tutorial with TF1, because the scripts given on the actual tutorial are for TF2 and I searched the right files in the TF OB API.

So replacing them in the original tutorial should work or not?

Well, this might work but replacing something in the tutorial might be not enough to run on TF1 because further changes to object_detection library should be done to downgrade to TF1.

@Petros626
Copy link

Petros626 commented Jun 25, 2022

@amrzv Hey, Can I ask you something about the: generate_ssd_anchor_box_aspect_ratios_using_k_means_clustering.ipynb Tutorial?

Yes, sure, I will try to help.

Sorry I was ill and couldn't answer. So my question is about the use of ssd custom anchor tutorial with TF1, because the scripts given on the actual tutorial are for TF2 and I searched the right files in the TF OB API.
So replacing them in the original tutorial should work or not?

Well, this might work but replacing something in the tutorial might be not enough to run on TF1 because further changes to object_detection library should be done to downgrade to TF1.

So I have already asked the question in repo tensorflow (#10665 (comment)), there I was told it would also work with TF1. For this, I assume that these sections simply have to be changed, as they are also available for TF1 in the Object Detection API.

# Install TensorFlow Object Detection API
%cp object_detection/packages/tf2/setup.py . CHANGE TO  **%cp object_detection/packages/tf1/setup.py.** 
! python -m pip install --upgrade pip
! python -m pip install --use-feature=2020-resolver .

# Test the installation
! python object_detection/builders/model_builder_tf2_test.py CHANGE TO ! python object_detection/builders/model_builder_tf1_test.py

all other scripts do not need TensorFlow, except for

import tensorflow as tf
from google.protobuf import text_format
from object_detection.protos import pipeline_pb2 

my questions to you would be have you successfully run this tutorial before and do you think I could give it a try with my approach? Otherwise I would have to install tensorflow 2.

@amrzv
Copy link
Author

amrzv commented Jun 25, 2022

I suggest using tf2 without any problems.
I didn't try to run these notebooks on tf1.
You can try to run with your changes (and possibly others) on tf1 in colaboratory where you can install any version of tf.

@Petros626
Copy link

Petros626 commented Jun 27, 2022

I suggest using tf2 without any problems. I didn't try to run these notebooks on tf1. You can try to run with your changes (and possibly others) on tf1 in colaboratory where you can install any version of tf.

maybe i'm misunderstanding jupyter notebook, but when i run the cells for the object detection tutorial, for example, i noticed that TF2 is installed when i run it, even though i have TF1 (virtual environment) installed on my computer.

Is Jupyter Notebook to be understood in a way that installations in cells are not executed locally, but everything online? It made me a bit puzzled, because there was always in the past a bar of my RAM and the DISK displayed, which are connected via the Python kernel, so to speak.

jupyter notebook

@amrzv
Copy link
Author

amrzv commented Jun 27, 2022

You run jupyter notebook locally and add installations that are made into the environment (globally or from any env), from which you start jupyter-notebook. So to answer your question - no, installations are not executed online.
Here you can find an example of how to start jupyter-notebook inside a specific environment.

P.S: this discussion become off-topic from object detection api.

@Petros626
Copy link

You run jupyter notebook locally and add installations that are made into the environment (globally or from any env), from which you start jupyter-notebook. So to answer your question - no, installations are not executed online. Here you can find an example of how to start jupyter-notebook inside a specific environment.

P.S: this discussion become off-topic from object detection api.

Okay thanks for the explanation, I will try it first with TF1 on my virtual environment and then see if it`s necessary to setup TF2. Could you share an e-mail address where I could contact you for further questions if needed.

@amrzv
Copy link
Author

amrzv commented Jun 27, 2022

Yes:
ao dot morozov at phystech dot edu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants