Skip to content

Commit 9dac4c6

Browse files
authored
fix windows bugs (#30)
1 parent 3bb2c86 commit 9dac4c6

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

README.md

+18-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Grounding DINO
1+
# :sauropod: Grounding DINO
22

33
---
44

@@ -28,7 +28,7 @@ Extensions | [Grounding DINO with Segment Anything](https://github.com/IDEA-Rese
2828
Official PyTorch implementation of [Grounding DINO](https://arxiv.org/abs/2303.05499), a stronger open-set object detector. Code is available now!
2929

3030

31-
## Highlight
31+
## :bulb: Highlight
3232

3333
- **Open-Set Detection.** Detect **everything** with language!
3434
- **High Performancce.** COCO zero-shot **52.5 AP** (training without COCO data!). COCO fine-tune **63.0 AP**.
@@ -37,10 +37,10 @@ Official PyTorch implementation of [Grounding DINO](https://arxiv.org/abs/2303.0
3737

3838

3939

40-
## News
40+
## :fire: News
4141
- **`2023/04/08`**: We release [demos](demo/image_editing_with_groundingdino_gligen.ipynb) to combine [Grounding DINO](https://arxiv.org/abs/2303.05499) with [GLIGEN](https://github.com/gligen/GLIGEN) for more controllable image editings.
4242
- **`2023/04/08`**: We release [demos](demo/image_editing_with_groundingdino_stablediffusion.ipynb) to combine [Grounding DINO](https://arxiv.org/abs/2303.05499) with [Stable Diffusion](https://github.com/Stability-AI/StableDiffusion) for image editings.
43-
- **`2023/04/06`**: We build a new demo by marrying GroundingDINO with [Segment-Anything](https://github.com/facebookresearch/segment-anything) named [Grounded-Segment-Anything](https://github.com/IDEA-Research/Grounded-Segment-Anything) aims to support segmentation in GroundingDINO.
43+
- **`2023/04/06`**: We build a new demo by marrying GroundingDINO with [Segment-Anything](https://github.com/facebookresearch/segment-anything) named **[Grounded-Segment-Anything](https://github.com/IDEA-Research/Grounded-Segment-Anything)** aims to support segmentation in GroundingDINO.
4444
- **`2023/03/28`**: A YouTube [video](https://youtu.be/cMa77r3YrDk) about Grounding DINO and basic object detection prompt engineering. [[SkalskiP](https://github.com/SkalskiP)]
4545
- **`2023/03/28`**: Add a [demo](https://huggingface.co/spaces/ShilongLiu/Grounding_DINO_demo) on Hugging Face Space!
4646
- **`2023/03/27`**: Support CPU-only mode. Now the model can run on machines without GPUs.
@@ -59,22 +59,22 @@ Marrying <a href="https://github.com/IDEA-Research/GroundingDINO">Grounding DINO
5959

6060

6161

62-
## TODO
62+
## :label: TODO
6363

6464
- [x] Release inference code and demo.
6565
- [x] Release checkpoints.
6666
- [x] Grounding DINO with Stable Diffusion and GLIGEN demos.
6767
- [ ] Release training codes.
6868

69-
## Install
69+
## :hammer_and_wrench: Install
7070

7171
If you have a CUDA environment, please make sure the environment variable `CUDA_HOME` is set. It will be compiled under CPU-only mode if no CUDA available.
7272

7373
```bash
7474
pip install -e .
7575
```
7676

77-
## Demo
77+
## :arrow_forward: Demo
7878

7979
```bash
8080
CUDA_VISIBLE_DEVICES=6 python demo/inference_on_a_image.py \
@@ -91,7 +91,13 @@ See the `demo/inference_on_a_image.py` for more details.
9191

9292
We also provide a demo code to integrate Grounding DINO with Gradio Web UI. See the file `demo/gradio_app.py` for more details.
9393

94-
## Checkpoints
94+
**Notebooks**
95+
96+
- We release [demos](demo/image_editing_with_groundingdino_gligen.ipynb) to combine [Grounding DINO](https://arxiv.org/abs/2303.05499) with [GLIGEN](https://github.com/gligen/GLIGEN) for more controllable image editings.
97+
- We release [demos](demo/image_editing_with_groundingdino_stablediffusion.ipynb) to combine [Grounding DINO](https://arxiv.org/abs/2303.05499) with [Stable Diffusion](https://github.com/Stability-AI/StableDiffusion) for image editings.
98+
99+
100+
## :luggage: Checkpoints
95101

96102
<!-- insert a table -->
97103
<table>
@@ -128,7 +134,7 @@ We also provide a demo code to integrate Grounding DINO with Gradio Web UI. See
128134
</tbody>
129135
</table>
130136

131-
## Results
137+
## :medal_military: Results
132138

133139
<details open>
134140
<summary><font size="4">
@@ -161,14 +167,14 @@ See our example <a href="https://github.com/IDEA-Research/GroundingDINO/blob/mai
161167
<img src=".asset/GD_GLIGEN.png" alt="GD_GLIGEN" width="100%">
162168
</details>
163169

164-
## Model
170+
## :sauropod: Model: Grounding DINO
165171

166172
Includes: a text backbone, an image backbone, a feature enhancer, a language-guided query selection, and a cross-modality decoder.
167173

168174
![arch](.asset/arch.png)
169175

170176

171-
## Acknowledgement
177+
## :hearts: Acknowledgement
172178

173179
Our model is related to [DINO](https://github.com/IDEA-Research/DINO) and [GLIP](https://github.com/microsoft/GLIP). Thanks for their great work!
174180

@@ -177,7 +183,7 @@ We also thank great previous work including DETR, Deformable DETR, SMCA, Conditi
177183
Thanks [Stable Diffusion](https://github.com/Stability-AI/StableDiffusion) and [GLIGEN](https://github.com/gligen/GLIGEN) for their awesome models.
178184

179185

180-
## Citation
186+
## :black_nib: Citation
181187

182188
If you find our work helpful for your research, please consider citing the following BibTeX entry.
183189

groundingdino/util/slconfig.py

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Modified from mmcv
33
# ==========================================================
44
import ast
5+
import os
56
import os.path as osp
67
import shutil
78
import sys
@@ -80,6 +81,8 @@ def _file2dict(filename):
8081
with tempfile.TemporaryDirectory() as temp_config_dir:
8182
temp_config_file = tempfile.NamedTemporaryFile(dir=temp_config_dir, suffix=".py")
8283
temp_config_name = osp.basename(temp_config_file.name)
84+
if os.name == 'nt':
85+
temp_config_file.close()
8386
shutil.copyfile(filename, osp.join(temp_config_dir, temp_config_name))
8487
temp_module_name = osp.splitext(temp_config_name)[0]
8588
sys.path.insert(0, temp_config_dir)

0 commit comments

Comments
 (0)