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

Add: DETR: End-to-End Object Detection with Transformers #832

Closed
wants to merge 4 commits into from
Closed

Add: DETR: End-to-End Object Detection with Transformers #832

wants to merge 4 commits into from

Conversation

ayyucedemirbas
Copy link

I've accidentally deleted the PR, so sorry about that.

I've prepared a new one from scratch that shows how to load a custom dataset and fine-tune the pre-trained model. Codes are copied from the repo with some modifications. I don't clone the repo, have copied the necessary python modules and edited them to run them on jupyter notebook. Could you please let me know whether this one is suitable or not?

Thank you so much!

@fchollet
Copy link
Member

Thanks for the update. The example is now very long (4,300 lines) and the code remains very frameworkey (lots of config related logic). We should aim at a ~300 lines example, e.g. ~50 lines for data loading / preprocessing, ~50 lines of utilities, 150 lines of model definition, 50 lines for fine-tuning / inference. Does that sound realistic for this model, or is that not possible?

@ayyucedemirbas
Copy link
Author

Thanks for your time and attention. To reduce the lines of code, I must clone the repo or get some of the .py files using wget. Is one of these solutions convenient?

@fchollet
Copy link
Member

Are you able to recreate a very simple re-implementation of the model from scratch in a small amount of code?

@ayyucedemirbas
Copy link
Author

This example uses a pre-trained model. If I build a new one, I must train it from scratch. I guess that takes a long time. I'm going to try to do that but I'm not sure it's possible or not. By the way, I've prepared an EEG Signal Classification example, could you please take a look at it? I've accidentally included it in this PR. Thank you so much!

@fchollet
Copy link
Member

If I build a new one, I must train it from scratch

You could simply download a weights file and load it into the model.

By the way, I've prepared an EEG Signal Classification example, could you please take a look at it

Nice! I've taken a look. One important point is that we should focus the example on techniques that are specific to EEG signals, so we shouldn't just apply a Dense network to the raw signal. We should do signal processing.

The key characteristic of EEG signals is that they vary from person to person, so you need to do domain adaption (from one person to the next) to classify effectively. How about you find a recent paper on the subject and you try to reimplement it?

@ayyucedemirbas
Copy link
Author

Thank you so much for your reply! (And I'm so sorry for my late reply, I'm an undergrad student who has lots of quizzes and assignments) I'm working on them.

@fchollet
Copy link
Member

fchollet commented Apr 8, 2022

Ok, sounds good! Please let me know when you have something you'd like me to review.

I've reduced lines of code to almost 1100 lines (this is my best), tutobooks.py script increased it to 1935 lines. 

Thank you so much!
@ayyucedemirbas
Copy link
Author

I've reduced lines of code to almost 1100 lines (this is my best), tutobooks.py script increased it to 1935 lines.

Thank you so much!

@fchollet
Copy link
Member

fchollet commented May 9, 2022

The script will simply apply black formatting to the code. The lines should be counted after formatting.

To count the actual number of lines of code, you can use python tutobooks.py count_loc fname

In the meantime, we've published this example: https://keras.io/examples/vision/object_detection_using_vision_transformer/ -- did you check it out?

@ayyucedemirbas
Copy link
Author

Oh, I am so sorry. I didn’t see that.

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

Successfully merging this pull request may close these issues.

2 participants