Skip to content

Commit 20ce13b

Browse files
authored
Merge branch 'main' into main
2 parents ed32070 + 536dc9d commit 20ce13b

File tree

6 files changed

+28
-66
lines changed

6 files changed

+28
-66
lines changed

.github/actions/install_linux_dep/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
shell: bash
1818
run: |
1919
# disable crash coredump, so unittests fail fast
20-
sudo systemctl stop apport.service
20+
sudo systemctl stop apport.service || true
2121
2222
pip install -U pip
2323

.github/workflows/workflow.yml

+15-15
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ jobs:
1212
# run on PRs, or commits to facebookresearch (not internal)
1313
if: ${{ github.repository_owner == 'facebookresearch' || github.event_name == 'pull_request' }}
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Set up Python 3.9
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v4
1818
with:
1919
python-version: 3.9
2020
- name: Install dependencies
2121
# flake8-bugbear flake8-comprehensions are useful but not available internally
2222
run: |
2323
python -m pip install --upgrade pip
2424
python -m pip install flake8==6.1.0 isort==4.3.21
25-
python -m pip install black==24.3.0
25+
python -m pip install black==24.4.2
2626
flake8 --version
2727
- name: Lint
2828
run: |
@@ -51,13 +51,13 @@ jobs:
5151
DETECTRON2_DATASETS: ~/.torch/datasets
5252
steps:
5353
- name: Checkout
54-
uses: actions/checkout@v2
54+
uses: actions/checkout@v4
5555
- name: Set up Python 3.8
56-
uses: actions/setup-python@v2
56+
uses: actions/setup-python@v4
5757
with:
5858
python-version: 3.8
5959
- name: Cache dependencies
60-
uses: actions/cache@v2
60+
uses: actions/cache@v4
6161
with:
6262
path: |
6363
${{ env.pythonLocation }}/lib/python3.8/site-packages
@@ -103,15 +103,15 @@ jobs:
103103
DETECTRON2_DATASETS: ~/.torch/datasets
104104
steps:
105105
- name: Checkout
106-
uses: actions/checkout@v2
106+
uses: actions/checkout@v4
107107

108108
- name: Set up Python 3.8
109-
uses: actions/setup-python@v2
109+
uses: actions/setup-python@v4
110110
with:
111111
python-version: 3.8
112112

113113
- name: Cache dependencies
114-
uses: actions/cache@v2
114+
uses: actions/cache@v4
115115
id: load-cache
116116
with:
117117
path: |
@@ -159,15 +159,15 @@ jobs:
159159
DETECTRON2_DATASETS: ~/.torch/datasets
160160
steps:
161161
- name: Checkout
162-
uses: actions/checkout@v2
162+
uses: actions/checkout@v4
163163

164164
- name: Set up Python 3.8
165-
uses: actions/setup-python@v2
165+
uses: actions/setup-python@v4
166166
with:
167167
python-version: 3.8
168168

169169
- name: Cache dependencies
170-
uses: actions/cache@v2
170+
uses: actions/cache@v4
171171
id: load-cache
172172
with:
173173
path: |
@@ -210,15 +210,15 @@ jobs:
210210
DETECTRON2_DATASETS: ~/.torch/datasets
211211
steps:
212212
- name: Checkout
213-
uses: actions/checkout@v2
213+
uses: actions/checkout@v4
214214

215215
- name: Set up Python 3.8
216-
uses: actions/setup-python@v2
216+
uses: actions/setup-python@v4
217217
with:
218218
python-version: 3.8
219219

220220
- name: Cache dependencies
221-
uses: actions/cache@v2
221+
uses: actions/cache@v4
222222
id: load-cache
223223
with:
224224
path: |

INSTALL.md

-35
Original file line numberDiff line numberDiff line change
@@ -26,41 +26,6 @@ CC=clang CXX=clang++ ARCHFLAGS="-arch x86_64" python -m pip install ...
2626
To __rebuild__ detectron2 that's built from a local clone, use `rm -rf build/ **/*.so` to clean the
2727
old build first. You often need to rebuild detectron2 after reinstalling PyTorch.
2828

29-
### Install Pre-Built Detectron2 (Linux only)
30-
31-
Choose from this table to install [v0.6 (Oct 2021)](https://github.com/facebookresearch/detectron2/releases):
32-
33-
<table class="docutils"><tbody><th width="80"> CUDA </th><th valign="bottom" align="left" width="100">torch 1.10</th><th valign="bottom" align="left" width="100">torch 1.9</th><th valign="bottom" align="left" width="100">torch 1.8</th> <tr><td align="left">11.3</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
34-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu113/torch1.10/index.html
35-
</code></pre> </details> </td> <td align="left"> </td> <td align="left"> </td> </tr> <tr><td align="left">11.1</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
36-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.10/index.html
37-
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
38-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.9/index.html
39-
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
40-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu111/torch1.8/index.html
41-
</code></pre> </details> </td> </tr> <tr><td align="left">10.2</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
42-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.10/index.html
43-
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
44-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.9/index.html
45-
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
46-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu102/torch1.8/index.html
47-
</code></pre> </details> </td> </tr> <tr><td align="left">10.1</td><td align="left"> </td> <td align="left"> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
48-
https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html
49-
</code></pre> </details> </td> </tr> <tr><td align="left">cpu</td><td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
50-
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.10/index.html
51-
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
52-
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html
53-
</code></pre> </details> </td> <td align="left"><details><summary> install </summary><pre><code>python -m pip install detectron2 -f \
54-
https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.8/index.html
55-
</code></pre> </details> </td> </tr></tbody></table>
56-
57-
Note that:
58-
1. The pre-built packages have to be used with corresponding version of CUDA and the official package of PyTorch.
59-
Otherwise, please build detectron2 from source.
60-
2. New packages are released every few months. Therefore, packages may not contain latest features in the main
61-
branch and may not be compatible with the main branch of a research project that uses detectron2
62-
(e.g. those in [projects](projects)).
63-
6429
### Common Installation Issues
6530

6631
Click each issue for its solutions:

README.md

+3-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
<img src=".github/Detectron2-Logo-Horz.svg" width="300" >
22

3-
<a href="https://opensource.facebook.com/support-ukraine">
4-
<img src="https://img.shields.io/badge/Support-Ukraine-FFD500?style=flat&labelColor=005BBB" alt="Support Ukraine - Help Provide Humanitarian Aid to Ukraine." />
5-
</a>
6-
73
Detectron2 is Facebook AI Research's next generation library
84
that provides state-of-the-art detection and segmentation algorithms.
95
It is the successor of
@@ -18,19 +14,15 @@ It supports a number of computer vision research projects and production applica
1814

1915
## Learn More about Detectron2
2016

21-
Explain Like I’m 5: Detectron2 | Using Machine Learning with Detectron2
22-
:-------------------------:|:-------------------------:
23-
[![Explain Like I’m 5: Detectron2](https://img.youtube.com/vi/1oq1Ye7dFqc/0.jpg)](https://www.youtube.com/watch?v=1oq1Ye7dFqc) | [![Using Machine Learning with Detectron2](https://img.youtube.com/vi/eUSgtfK4ivk/0.jpg)](https://www.youtube.com/watch?v=eUSgtfK4ivk)
24-
25-
## What's New
2617
* Includes new capabilities such as panoptic segmentation, Densepose, Cascade R-CNN, rotated bounding boxes, PointRend,
2718
DeepLab, ViTDet, MViTv2 etc.
2819
* Used as a library to support building [research projects](projects/) on top of it.
2920
* Models can be exported to TorchScript format or Caffe2 format for deployment.
3021
* It [trains much faster](https://detectron2.readthedocs.io/notes/benchmarks.html).
3122

32-
See our [blog post](https://ai.facebook.com/blog/-detectron2-a-pytorch-based-modular-object-detection-library-/)
33-
to see more demos and learn about detectron2.
23+
See our [blog post](https://ai.meta.com/blog/-detectron2-a-pytorch-based-modular-object-detection-library-/)
24+
to see more demos.
25+
See this [interview](https://ai.meta.com/blog/detectron-everingham-prize/) to learn more about the stories behind detectron2.
3426

3527
## Installation
3628

detectron2/data/datasets/cityscapes.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ def _cityscapes_files_to_dict(files, from_json, to_polygons):
138138
Returns:
139139
A dict in Detectron2 Dataset format.
140140
"""
141-
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import id2label, name2label
141+
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import (
142+
id2label,
143+
name2label,
144+
)
142145

143146
image_file, instance_id_file, _, json_file = files
144147

detectron2/evaluation/cityscapes_evaluation.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def evaluate(self):
9696
comm.synchronize()
9797
if comm.get_rank() > 0:
9898
return
99-
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling as cityscapes_eval, deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling
99+
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalInstanceLevelSemanticLabeling as cityscapes_eval # noqa: E501
100100

101101
self._logger.info("Evaluating results under {} ...".format(self._temp_dir))
102102

@@ -140,7 +140,9 @@ class CityscapesSemSegEvaluator(CityscapesEvaluator):
140140
"""
141141

142142
def process(self, inputs, outputs):
143-
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import trainId2label
143+
from deeplearning.projects.cityscapesApi.cityscapesscripts.helpers.labels import (
144+
trainId2label,
145+
)
144146

145147
for input, output in zip(inputs, outputs):
146148
file_name = input["file_name"]
@@ -161,7 +163,7 @@ def evaluate(self):
161163
return
162164
# Load the Cityscapes eval script *after* setting the required env var,
163165
# since the script reads CITYSCAPES_DATASET into global variables at load time.
164-
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling as cityscapes_eval, deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling
166+
import deeplearning.projects.cityscapesApi.cityscapesscripts.evaluation.evalPixelLevelSemanticLabeling as cityscapes_eval # noqa: E501
165167

166168
self._logger.info("Evaluating results under {} ...".format(self._temp_dir))
167169

0 commit comments

Comments
 (0)