Update README.md
Browse files
README.md
CHANGED
|
@@ -1,12 +1,19 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
| 4 |
```
|
|
|
|
|
|
|
| 5 |
|
| 6 |
from frcnn.visualizing_image import SingleImageViz
|
| 7 |
from frcnn.processing_image import Preprocess
|
| 8 |
from frcnn.modeling_frcnn import GeneralizedRCNN
|
| 9 |
from frcnn.utils import Config
|
|
|
|
| 10 |
max_detections = 36
|
| 11 |
frcnn_config = json.load(open("frcnn/config.jsonl"))
|
| 12 |
frcnn_config = Config(frcnn_config)
|
|
@@ -15,6 +22,5 @@ box_segmentation_model= GeneralizedRCNN.from_pretrained("unc-nlp/frcnn-vg-finetu
|
|
| 15 |
|
| 16 |
img_url = 'image.png'
|
| 17 |
raw_image = Image.open(img_url).convert('RGB')
|
| 18 |
-
frcnn_output = decode_image(asarray(raw_image), frcnn, image_preprocessor, max_detections=max_detections)
|
| 19 |
-
|
| 20 |
```
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
library_name: PyTorch
|
| 4 |
+
tags:
|
| 5 |
+
- bounding box detection
|
| 6 |
---
|
| 7 |
+
|
| 8 |
```
|
| 9 |
+
import numpy as np
|
| 10 |
+
from PIL import Image
|
| 11 |
|
| 12 |
from frcnn.visualizing_image import SingleImageViz
|
| 13 |
from frcnn.processing_image import Preprocess
|
| 14 |
from frcnn.modeling_frcnn import GeneralizedRCNN
|
| 15 |
from frcnn.utils import Config
|
| 16 |
+
|
| 17 |
max_detections = 36
|
| 18 |
frcnn_config = json.load(open("frcnn/config.jsonl"))
|
| 19 |
frcnn_config = Config(frcnn_config)
|
|
|
|
| 22 |
|
| 23 |
img_url = 'image.png'
|
| 24 |
raw_image = Image.open(img_url).convert('RGB')
|
| 25 |
+
frcnn_output = decode_image(np.asarray(raw_image), frcnn, image_preprocessor, max_detections=max_detections)
|
|
|
|
| 26 |
```
|