logo
Browse Source

Update

Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
Jael Gu 2 years ago
parent
commit
3f7c712042
  1. 20
      README.md
  2. 1
      requirements.txt
  3. BIN
      result.png

20
README.md

@ -13,19 +13,19 @@ This operator uses Facebook's [Detectron2](https://github.com/facebookresearch/d
## Code Example ## Code Example
```python ```python
import towhee
from towhee.dc2 import pipe, ops, DataCollection
towhee.glob('./example.jpg') \
.image_decode() \
.object_detection.detectron2(model_name='retinanet_resnet50') \
.show()
```
| Image | `boxes` | `classes` | `scores` |
| ----- | ------- | --------- | -------- |
| ![](example.jpg) | `array([2645.9973, 1200.3245, 3176.163, 2722.6785])` | `array([0])` | `array([0.9998573])` |
p = (
pipe.input('path')
.map('path', 'img', ops.image_decode())
.map('img', ('boxes', 'classes', 'scores'), ops.object_detection.detectron2(model_name='retinanet_resnet50'))
.output('img', 'boxes', 'classes', 'scores')
)
DataCollection(p('./example.jpg')).show()
```
<img src="./result.png" alt="result" height="140px"/>
## Factory Constructor ## Factory Constructor

1
requirements.txt

@ -2,4 +2,3 @@ torch >= 1.8
torchvision >= 0.9.0 torchvision >= 0.9.0
black==21.4b2 black==21.4b2
detectron2@https://github.com/facebookresearch/detectron2/archive/refs/tags/v0.6.tar.gz detectron2@https://github.com/facebookresearch/detectron2/archive/refs/tags/v0.6.tar.gz
# detectron2@git+https://github.com/facebookresearch/detectron2.git@v0.6#egg=detectron2

BIN
result.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

Loading…
Cancel
Save