Add DETA (#20983)
* First draft * Add initial draft of conversion script * Convert all weights * Fix config * Add image processor * Fix DetaImageProcessor * Run make fix copies * Remove timm dependency * Fix dummy objects * Improve loss function * Remove conv_encoder attribute * Update conversion scripts * Improve postprocessing + docs * Fix copied from statements * Add tests * Improve postprocessing * Improve postprocessing * Update READMEs * More improvements * Fix rebase * Add is_torchvision_available * Add torchvision dependency * Fix typo and README * Fix bug * Add copied from * Fix style * Apply suggestions * Fix thanks to @ydshieh * Fix another dependency check * Simplify image processor * Add scipy * Improve code * Add threshold argument * Fix bug * Set default threshold * Improve integration test * Add another integration test * Update setup.py * Address review * Improve deformable attention function * Improve copied from * Use relative imports * Address review * Replace assertions * Address review * Update dummies * Remove dummies * Address comments, update READMEs * Remove custom kernel code * Add image processor tests * Add requires_backends * Add minor comment * Update scripts * Update organization name * Fix defaults, add doc tests * Add id2label for object 365 * Fix tests * Update task guide
This commit is contained in:
@@ -90,6 +90,7 @@ from .utils import (
|
||||
is_torch_tpu_available,
|
||||
is_torchaudio_available,
|
||||
is_torchdynamo_available,
|
||||
is_torchvision_available,
|
||||
is_vision_available,
|
||||
)
|
||||
|
||||
@@ -307,6 +308,16 @@ def require_torch(test_case):
|
||||
return unittest.skipUnless(is_torch_available(), "test requires PyTorch")(test_case)
|
||||
|
||||
|
||||
def require_torchvision(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires Torchvision.
|
||||
|
||||
These tests are skipped when Torchvision isn't installed.
|
||||
|
||||
"""
|
||||
return unittest.skipUnless(is_torchvision_available(), "test requires Torchvision")(test_case)
|
||||
|
||||
|
||||
def require_torch_or_tf(test_case):
|
||||
"""
|
||||
Decorator marking a test that requires PyTorch or TensorFlow.
|
||||
|
||||
Reference in New Issue
Block a user