Ontocord.AI commited on
Commit ·
8c2dd5d
1
Parent(s): e8cc13d
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
```
|
| 5 |
+
from frcnn.frcnn_ids import *
|
| 6 |
+
from frcnn.visualizing_image import SingleImageViz
|
| 7 |
+
from frcnn.processing_image import *
|
| 8 |
+
from frcnn.modeling_frcnn import *
|
| 9 |
+
from frcnn.utils import *
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
max_detections = 36
|
| 13 |
+
frcnn_config = json.load(open("frcnn/config.jsonl"))
|
| 14 |
+
frcnn_config = Config(frcnn_config)
|
| 15 |
+
frcnn = GeneralizedRCNN(frcnn_config).half().cuda()
|
| 16 |
+
image_preprocessor = Preprocess(frcnn_config).half().cuda()
|
| 17 |
+
|
| 18 |
+
img_url = 'image2.png'
|
| 19 |
+
raw_image = Image.open(img_url).convert('RGB')
|
| 20 |
+
frcnn_output = decode_image(asarray(raw_image), frcnn, image_preprocessor, max_detections=max_detections)
|
| 21 |
+
|
| 22 |
+
```
|