-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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 support for modular with fast image processors #35379
base: main
Are you sure you want to change the base?
Add support for modular with fast image processors #35379
Conversation
def post_process_segmentation(): | ||
raise NotImplementedError("Segmentation post-processing is not implemented for Deformable DETR yet.") | ||
|
||
def post_process_instance(): | ||
raise NotImplementedError("Instance post-processing is not implemented for Deformable DETR yet.") | ||
|
||
def post_process_panoptic(): | ||
raise NotImplementedError("Panoptic post-processing is not implemented for Deformable DETR yet.") | ||
|
||
def post_process_instance_segmentation(): | ||
raise NotImplementedError("Segmentation post-processing is not implemented for Deformable DETR yet.") | ||
|
||
def post_process_semantic_segmentation(): | ||
raise NotImplementedError("Semantic segmentation post-processing is not implemented for Deformable DETR yet.") | ||
|
||
def post_process_panoptic_segmentation(): | ||
raise NotImplementedError("Panoptic segmentation post-processing is not implemented for Deformable DETR yet.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I wanted to remove these inherited functions. Somehow this works, but I'm not sure if there is a better way to do this?
Using modular the other way (with DetrImageProcessorFast
inheriting from DeformableDetrImageProcessorFast
) would solve the problem, but this wouldn't make sense chronologically.
def from_dict(): | ||
raise NotImplementedError("No need to override this method for RT-DETR yet.") | ||
|
||
def post_process(): | ||
raise NotImplementedError("Post-processing is not implemented for RT-DETR yet.") | ||
|
||
def post_process_segmentation(): | ||
raise NotImplementedError("Segmentation post-processing is not implemented for RT-DETR yet.") | ||
|
||
def post_process_instance(): | ||
raise NotImplementedError("Instance post-processing is not implemented for RT-DETR yet.") | ||
|
||
def post_process_panoptic(): | ||
raise NotImplementedError("Panoptic post-processing is not implemented for RT-DETR yet.") | ||
|
||
def post_process_instance_segmentation(): | ||
raise NotImplementedError("Segmentation post-processing is not implemented for RT-DETR yet.") | ||
|
||
def post_process_semantic_segmentation(): | ||
raise NotImplementedError("Semantic segmentation post-processing is not implemented for RT-DETR yet.") | ||
|
||
def post_process_panoptic_segmentation(): | ||
raise NotImplementedError("Panoptic segmentation post-processing is not implemented for RT-DETR yet.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
if dep_name == node_name: | ||
# Skip self dependencies for topological sort as they create cycles | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the case in ijepa for example, where we import IJepaConfig
in modular
@@ -54,7 +59,7 @@ def extract_classes_and_imports(file_path): | |||
for node in ast.walk(tree): | |||
if isinstance(node, (ast.Import, ast.ImportFrom)): | |||
module = node.module if isinstance(node, ast.ImportFrom) else None | |||
if module and (".modeling_" in module): | |||
if module and (".modeling_" in module or "transformers.models" in module): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ArthurZucker @Cyrilvallez This was changed in a recent PR, but seems to have broken modular for generating files other than modeling
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
What does this PR do?
Add support for using modular with fast image processors
Also add a fix for using modular on files other than modeling, which seem to have been broken by a recent change
Who can review?
@Cyrilvallez