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

Video Swin model adds to kerashub #1981

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

Conversation

kernel-loophole
Copy link

#1755
@divyashreepathihalli

Copy link

google-cla bot commented Nov 11, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@kernel-loophole
Copy link
Author

Hi @divyashreepathihalli! I need some guidance on how to test this locally. Could you help me with the steps?

@kernel-loophole
Copy link
Author

@divyashreepathihalli can you run test again.

@kernel-loophole kernel-loophole changed the title Video Swin model added to kerashub Video Swin model adds to kerashub Nov 13, 2024
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Higher level feedback for a start.

  • Remove all "aliases," that's a CV pattern we did not continue. All arch configurations are stored in json files we upload to Kaggle/HF. The "aliases" is just the preset name you want to use.
  • Follow the task setup we have in KerasHub. I am guessing for this model we want to add a VideoClassifier task that we can model heavily on ImageClassifier.
  • Remove all instances of keras_cv whereever they are.
  • Remove the presets stuff until presets are actually upload.

This will need a much more substantial rewrite to match the abstractions of KerasHub, rather than a more direct copy.

@kernel-loophole
Copy link
Author

Thank you for the feedback. I will remove the aliases and replace them with the appropriate configurations stored in JSON files for Kaggle/HF. I'll follow the KerasHub task setup and create the VideoClassifier task based on the ImageClassifier model.

@divyashreepathihalli
Copy link
Collaborator

@kernel-loophole are you still working on this? Please let us know once you are done addressing the comments.

@kernel-loophole
Copy link
Author

@divyashreepathihalli yes ,i was bit busy ,will try to add this weekend

@kernel-loophole
Copy link
Author

@mattdangerw update all cv pattern .configuration are in json file .it would be great if you can review and let me know your feedback on this .if you can provide any example on task setup that would also be great .

Copy link
Collaborator

@divyashreepathihalli divyashreepathihalli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kernel-loophole the PR would need more updates to match KerasHub model implementation style. please follow this folder here as an example - https://github.com/keras-team/keras-hub/tree/master/keras_hub/src/models/sam

keras_hub/src/models/video_swin/video_swin_aliases.py Outdated Show resolved Hide resolved
keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
input_tensor (KerasTensor, optional): Output of
`keras.layers.Input()`) to use as video input for the model.
Defaults to `None`.
include_rescaling (bool, optional): Whether to rescale the inputs. If
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type hints are specified in this format
arg_name: type. short description
please refer other model implementation -ex: https://github.com/keras-team/keras-hub/blob/master/keras_hub/src/models/vit/vit_backbone.py

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should i format all arg_name according to that .

keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
@kernel-loophole
Copy link
Author

kernel-loophole commented Jan 30, 2025

@divyashreepathihalli thanks for review .will update that shortly .

keras_hub/src/models/video_swin/video_swin_backbone.py Outdated Show resolved Hide resolved
input_tensor (KerasTensor, optional): Output of
`keras.layers.Input()`) to use as video input for the model.
Defaults to `None`.
include_rescaling (bool, optional): Whether to rescale the inputs. If
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should i format all arg_name according to that .


x = input_spec

# if include_rescaling:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by changing the default value of scaling can change the model behavior

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.

3 participants