https://github.com/bit-bots/yoeo
YouOnlyEncodeOnce - A CNN for Embedded Object Detection and Semantic Segmentation
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
✓Academic publication links
Links to: researchgate.net -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.1%) to scientific vocabulary
Repository
YouOnlyEncodeOnce - A CNN for Embedded Object Detection and Semantic Segmentation
Basic Info
Statistics
- Stars: 23
- Watchers: 9
- Forks: 6
- Open Issues: 16
- Releases: 0
Metadata Files
README.md
YOEO — You Only Encode Once
A CNN for Embedded Object Detection and Semantic Segmentation
This project is based upon PyTorch-YOLOv3 and will continuously be modified to our needs.









Installation
Installing from source
For normal training and evaluation we recommend installing the package from source using a poetry virtual environment.
bash
git clone https://github.com/bit-bots/YOEO
cd YOEO/
pip3 install poetry --user
poetry install
You need to join the virtual environment by running poetry shell in this directory before running any of the following commands without the poetry run prefix.
Also have a look at the other installing method, if you want to use the commands everywhere without opening a poetry-shell.
Download pretrained weights
bash
./weights/download_weights.sh
Test
Evaluates the model on the test dataset. See help page for more details.
bash
poetry run yoeo-test -h
Inference
Uses pretrained weights to make predictions on images.
bash
poetry run yoeo-detect --images data/samples/

Train
For argument descriptions have a look at poetry run yoeo-train --h
Tensorboard
Track training progress in Tensorboard: * Initialize training * Run the command below * Go to http://localhost:6006/
bash
poetry run tensorboard --logdir='logs' --port=6006
Storing the logs on a slow drive possibly leads to a significant training speed decrease.
You can adjust the log directory using --logdir <path> when running tensorboard and yoeo-train.
Train on Custom Dataset
Classes
Add class names to data/custom/yoeo_names.yaml.
Run the following command to adapt the model file (cfg) to the new number of classes:
bash
poetry run yoeo-custiomize-cfg -c config/yoeo.cfg -d config/custom.data -o config/yoeo-custom.cfg
This changes the layers of the model to fit the number of classes in your dataset.
Image Folder
Move the images of your dataset to data/custom/images/.
YOLO Annotation Folder
Move your yolo annotations to data/custom/labels/. The dataloader expects that the annotation file corresponding to the image data/custom/images/train.jpg has the path data/custom/labels/train.txt. Each row in the annotation file should define one bounding box, using the syntax label_idx x_center y_center width height. The coordinates should be scaled [0, 1], and the label_idx should be zero-indexed and correspond to the row number of the class name in data/custom/classes.names.
Segmentation Annotation Folder
Move your segmentation annotations to data/custom/yoeo_segmentations/. The dataloader expects that the annotation file corresponding to the image data/custom/images/train.jpg has the path data/custom/yoeo_segmentations/train.png. The classes for each pixel are encoded via the class id.
Define Train and Validation Sets
In data/custom/train.txt and data/custom/valid.txt, add paths to images that will be used as train and validation data respectively.
Train
To train on the custom dataset run:
bash
poetry run yoeo-train --model config/yoeo-custom.cfg --data config/custom.data
API
You are able to import the modules of this repo in your own project if you install this repo as a python package.
An example prediction call from a simple OpenCV python script would look like this:
```python import cv2 from yoeo import detect, models
Load the YOEO model
model = models.loadmodel( "<PATHTOYOURCONFIGFOLDER>/yoeo.cfg", "<PATHTOYOURWEIGHTS_FOLDER>/yoeo.pth")
Load the image as a numpy array
img = cv2.imread("
Convert OpenCV bgr to rgb
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
Runs the YOEO model on the image
boxes, segmentation = detect.detect_image(model, img)
print(boxes)
Output will be a numpy array in the following format:
[[x1, y1, x2, y2, confidence, class]]
print(segmentation)
Output will be a 2d numpy array with the coresponding class id in each cell
```
For more advanced usage look at the method's doc strings.
Convert your YOEO model
Convert your YOEO model to an ONNX model
To convert your YOEO model to an ONNX model, you can use the following command:
bash
poetry run yoeo-to-onnx config/yoeo.cfg # Replace path with your .cfg file
For more information on ONNX, read the ONNX runtime website.
Convert ONNX model to OpenVino IR model
After successful conversion of your YOEO model to an ONNX model using this guide, you can move on with the next conversion to an OpenVino IR model (intermediate representation) model using the following command:
bash
poetry run yoeo-onnx-to-openvino config/yoeo.onnx # Replace path with your .onnx file
For more information on OpenVino, read the OpenVino documentation.
Publication
YOEO — You Only Encode Once: A CNN for Embedded Object Detection and Semantic Segmentation
Abstract
Fast and accurate visual perception utilizing a robot’s limited hardware resources is necessary for many mobile robot applications.
We are presenting YOEO, a novel hybrid CNN which unifies previous object detection and semantic segmentation approaches using one shared encoder backbone to increase performance and accuracy.
We show that it outperforms previous approaches on the TORSO-21 and Cityscapes datasets.
@inproceedings{vahlyoeo,
title={YOEO — You Only Encode Once: A CNN for Embedded Object Detection and Semantic Segmentation},
author={Vahl, Florian and Gutsche, Jan and Bestmann, Marc and Zhang, Jianwei},
year={2021},
organization={IEEE},
booktitle={2021 IEEE International Conference on Robotics and Biomimetics (ROBIO)}
}
Owner
- Name: Hamburg Bit-Bots
- Login: bit-bots
- Kind: organization
- Location: Hamburg
- Website: https://www.bit-bots.de
- Repositories: 85
- Profile: https://github.com/bit-bots
Official Github account of Hamburg Bit-Bots
GitHub Events
Total
- Issues event: 3
- Watch event: 2
- Delete event: 2
- Issue comment event: 1
- Push event: 19
- Pull request review event: 2
- Pull request event: 3
- Fork event: 2
- Create event: 3
Last Year
- Issues event: 3
- Watch event: 2
- Delete event: 2
- Issue comment event: 1
- Push event: 19
- Pull request review event: 2
- Pull request event: 3
- Fork event: 2
- Create event: 3
Dependencies
- profilehooks 1.12.0 develop
- absl-py 1.0.0
- cachetools 3.1.1
- certifi 2021.10.8
- charset-normalizer 2.0.9
- colorama 0.4.4
- cycler 0.11.0
- dataclasses 0.8
- decorator 4.4.2
- flatbuffers 2.0
- google-auth 2.3.3
- google-auth-oauthlib 0.4.6
- grpcio 1.43.0
- idna 3.3
- imageio 2.13.5
- imgaug 0.4.0
- importlib-metadata 4.8.3
- importlib-resources 5.4.0
- kiwisolver 1.3.1
- markdown 3.3.6
- matplotlib 3.3.4
- networkx 2.5.1
- numpy 1.19.5
- oauthlib 3.1.1
- onnx 1.10.2
- onnx-simplifier 0.3.6
- onnxoptimizer 0.2.6
- onnxruntime 1.10.0
- onnxruntime-gpu 1.10.0
- opencv-python 4.5.2.54
- pillow 8.4.0
- protobuf 3.19.1
- pyasn1 0.4.8
- pyasn1-modules 0.2.8
- pyparsing 3.0.6
- python-dateutil 2.8.2
- pywavelets 1.1.1
- pyyaml 6.0
- requests 2.26.0
- requests-oauthlib 1.3.0
- rsa 4.4
- scikit-image 0.17.2
- scipy 1.5.4
- shapely 1.8.0
- six 1.16.0
- tensorboard 2.7.0
- tensorboard-data-server 0.6.1
- tensorboard-plugin-wit 1.8.0
- terminaltables 3.1.10
- tifffile 2020.9.3
- torch 1.10.1
- torchsummary 1.5.1
- torchvision 0.11.2
- tqdm 4.64.0
- typing-extensions 4.0.1
- urllib3 1.22
- werkzeug 2.0.2
- zipp 3.6.0
- opencv-python ^4.5.2 develop
- profilehooks ^1.12.0 develop
- Pillow ^8.4.0
- PyYAML ^6.0
- imgaug ^0.4.0
- matplotlib ^3.3.3
- numpy ^1.19.5
- onnx ^1.9.0
- onnx-simplifier ^0.3.5
- onnxruntime ^1.9.0
- onnxruntime-gpu ^1.9.0
- python >=3.6.2
- tensorboard ^2.7.0
- terminaltables ^3.1.10
- torch >=1.8.1
- torchsummary ^1.5.1
- torchvision >=0.8.2
- tqdm ^4.64.0
- TrueBrain/actions-flake8 master composite
- actions/checkout v2 composite
- actions/setup-python v1 composite