CV Tools related to Object Detection
Project description
Synapse Computer Vision Tools
More details are provided in Notion page.
Requirements
- Python 3.5+
- OpenCV
- Pillow
- LXML
- For TF Records - TensorFlow
Installation
Using PIP
pip3 import syncvtools
Visualize predictions from prod
from syncvtools.utils.draw_detections import DrawDetections
from syncvtools.utils.parsers import ProdDetections, TFRecords, TFObjDetAPIDetections
prod_dets = ProdDetections.parse_prod_detections(img_dir='IMAGE_DIRECTORY', predictions_dir='DETECTIONS_FILE_DIR')
drawer = DrawDetections(bbox_line_height=1, threshold=0.5)
for pro_det in prod_dets:
vis_img = drawer.draw_imageleveldetections(img_dets=prod_dets[pro_det])
cv2.imshow("predictions", vis_img)
cv2.waitKey(0)
Visualize predictions from TF training
from syncvtools.utils.draw_detections import DrawDetections
from syncvtools.utils.parsers import ProdDetections, TFRecords, TFObjDetAPIDetections
tf_inf = TFObjDetAPIDetections.parse_detections(detection_file='detections_and_losses.json')
tf_gts = TFRecords.parse(tfrecord_src='val.tfrecord')
#adding image info to predictions/gt
tf_inf += tf_gts
if label_map is not None:
tf_inf.process_labelmap('path_to_label_map.pbtxt')
drawer = DrawDetections(bbox_line_height=1, threshold=0.5)
for pro_det in tf_inf:
if not tf_inf[pro_det].detections and not tf_inf[pro_det].ground_truth:
continue #no gt/detections here
vis_img = drawer.draw_imageleveldetections(img_dets=tf_inf[pro_det])
cv2.imshow("predictions/gt from TF inference", vis_img)
cv2.waitKey(0)
utils
from syncvtools.utils import file_tools as ft
ft.get_file_list_by_ext(dir='input_path', ext=('jpg','png'))
Returns a list of string with full path to files with ext extension.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
syncvtools-0.1.13.tar.gz
(531.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
syncvtools-0.1.13-py3-none-any.whl
(552.7 kB
view details)
File details
Details for the file syncvtools-0.1.13.tar.gz.
File metadata
- Download URL: syncvtools-0.1.13.tar.gz
- Upload date:
- Size: 531.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a47c12c7f3cdd0eb1452e1224a67b174e11db3db205de429f642c3ce92827e44
|
|
| MD5 |
ae98b5debe74e4923a43ecb66bb34351
|
|
| BLAKE2b-256 |
94c55ad3b876e0f3e1c4a7fa3e76b2e9c78e6c1e2a04419b448ad3c319b01bc4
|
File details
Details for the file syncvtools-0.1.13-py3-none-any.whl.
File metadata
- Download URL: syncvtools-0.1.13-py3-none-any.whl
- Upload date:
- Size: 552.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1576fdae16affa917d1cb4eb5f4d70bd238ad7bbd552bf88094c6fcf705492f1
|
|
| MD5 |
e408be8118756d7ff6ef7ff387852941
|
|
| BLAKE2b-256 |
f0dedcedf75012725e1608d9a631789865128629f95c2167aed9763090d41a25
|