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

Remove lightning dependencies #355

Merged
merged 5 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ jobs:
pip install --user --progress-bar off pycocotools>=2.0.2
pip install --user --progress-bar off onnx
pip install --user --progress-bar off onnxruntime
pip install --user --progress-bar off pytorch_lightning
pip install --user --progress-bar off torchmetrics
pip install --user --progress-bar off onnxruntime
pip install --user onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com

- name: Lint with flake8
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ ipython
tabulate
pandas

# Lightning -----------------------------------
pytorch_lightning>=1.3.1
torchmetrics

# extras --------------------------------------
# pycocotools on PyPI needs python3.7 as minimal
# pycocotools>=2.0.2 # corresponds to https://github.com/ppwwyyxx/cocoapi
Expand Down
3 changes: 2 additions & 1 deletion test/test_data_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import numpy as np
import torch
from torch import Tensor
from yolort.data import DetectionDataModule, contains_any_tensor, _helper as data_helper
from yolort.data import contains_any_tensor, _helper as data_helper
from yolort.data.data_module import DetectionDataModule


def test_contains_any_tensor():
Expand Down
3 changes: 2 additions & 1 deletion test/test_models_yolov5.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
import torch
from torch import Tensor
from torchvision.io import read_image
from yolort.data import COCOEvaluator, _helper as data_helper
from yolort.data import _helper as data_helper
from yolort.data.coco_eval import COCOEvaluator
from yolort.models import yolov5s
from yolort.models.transform import YOLOTransform
from yolort.models.yolo import yolov5_darknet_pan_s_r31
Expand Down
3 changes: 2 additions & 1 deletion test/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import pytest
import pytorch_lightning as pl
from yolort.data import DetectionDataModule, _helper as data_helper
from yolort.data import _helper as data_helper
from yolort.data.data_module import DetectionDataModule
from yolort.trainer import DefaultTask


Expand Down
3 changes: 2 additions & 1 deletion tools/eval_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
import torch
import torchvision
import yolort
from yolort.data import COCOEvaluator, _helper as data_helper
from yolort.data import _helper as data_helper
from yolort.data.coco import COCODetection
from yolort.data.coco_eval import COCOEvaluator
from yolort.data.transforms import default_val_transforms, collate_fn
from yolort.utils.logger import MetricLogger

Expand Down
14 changes: 1 addition & 13 deletions yolort/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# Copyright (c) 2021, yolort team. All rights reserved.

from ._helper import contains_any_tensor
from .coco_eval import COCOEvaluator
from .data_module import (
DetectionDataModule,
VOCDetectionDataModule,
COCODetectionDataModule,
)

__all__ = [
"contains_any_tensor",
"COCOEvaluator",
"DetectionDataModule",
"VOCDetectionDataModule",
"COCODetectionDataModule",
]
__all__ = ["contains_any_tensor"]
2 changes: 2 additions & 0 deletions yolort/models/_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Copyright (c) 2020, yolort team. All rights reserved.

import math
from typing import Tuple, Optional

Expand Down
1 change: 1 addition & 0 deletions yolort/models/darknet.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2021, yolort team. All rights reserved.

from .darknetv4 import (
DarkNetV4,
darknet_s_r3_1,
Expand Down
3 changes: 2 additions & 1 deletion yolort/models/darknetv4.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2021, Zhiqiang Wang. All Rights Reserved.
# Copyright (c) 2021, yolort team. All rights reserved.

from typing import Callable, List, Optional, Any

import torch
Expand Down
3 changes: 2 additions & 1 deletion yolort/models/darknetv6.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2021, yolort team. All rights reserved.
from typing import Callable, List, Optional, Any

from typing import Any, Callable, List, Optional

import torch
from torch import nn, Tensor
Expand Down
5 changes: 3 additions & 2 deletions yolort/models/path_aggregation_network.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (c) 2021, Zhiqiang Wang. All Rights Reserved.
from typing import List, Dict, Callable, Optional
# Copyright (c) 2021, yolort team. All rights reserved.

from typing import Dict, List, Callable, Optional

import torch
from torch import nn, Tensor
Expand Down
6 changes: 1 addition & 5 deletions yolort/models/transformer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Copyright (c) 2021, Zhiqiang Wang. All Rights Reserved.
"""
The transformer attention network blocks.
# Copyright (c) 2021, yolort team. All rights reserved.

Mostly copy-paste from <https://github.com/dingyiwei/yolov5/tree/Transformer>.
"""
from typing import Callable, List, Optional

from torch import nn
Expand Down
2 changes: 1 addition & 1 deletion yolort/trainer/lightning_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pytorch_lightning import LightningModule
from torch import Tensor
from torchvision.ops import box_iou
from yolort.data import COCOEvaluator
from yolort.data.coco_eval import COCOEvaluator


__all__ = ["DefaultTask"]
Expand Down