Ontocord.AI
commited on
Commit
•
4a75742
1
Parent(s):
8c2dd5d
Update README.md
Browse files
README.md
CHANGED
@@ -2,20 +2,18 @@
|
|
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 |
-
|
16 |
-
|
17 |
-
|
18 |
-
img_url = '
|
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 |
|
|
|
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)
|
13 |
+
image_preprocessor= Preprocess(frcnn_config).half().cuda()
|
14 |
+
box_segmentation_model= GeneralizedRCNN.from_pretrained("unc-nlp/frcnn-vg-finetuned", frcnn_config).half().cuda()
|
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 |
|