Skip to content

Commit

Permalink
Update nn-ci-cpu-testing.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitroprobachay committed Dec 16, 2024
1 parent fb1cd69 commit b279baa
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 57 deletions.
66 changes: 15 additions & 51 deletions .github/workflows/nn-ci-cpu-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-18.04 ]
python-version: [ 3.7, 3.8, 3.9 ]
os: [ ubuntu-latest ]
python-version: [ 3.9 3.10 3.11 ]

# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 120
Expand Down Expand Up @@ -76,59 +76,26 @@ jobs:

- name: Tests workflow
run: |
# test train examples ocr
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/by.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/eu.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/ge.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/kg.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/kz.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/ua.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/ua-1995.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/su.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/ocr/ru.ipynb
# test train examples classification
#jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/classification/options-base-count_lines-train.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/classification/options-base-train.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/classification/options-custom-train.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/classification/options-train.ipynb
# test train examples object detection
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/train/object_detection/yolov5-train.ipynb
# test python inference examples
python examples/py/inference/get-started-demo.py
python examples/py/inference/get-started-tiny-demo.py
python examples/py/inference/number-plate-filling-demo.py
python examples/py/inference/number-plate-recognition-multiline-demo.py
python tutorials/py/inference/get-started-demo.py
python tutorials/py/inference/get-started-tiny-demo.py
python tutorials/py/inference/number-plate-filling-demo.py
# test jupyter inference examples
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/custom-options-model-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/get-started-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/get-started-tiny-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/number-plate-bbox-filling.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/number-plate-keypoints-filling.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/number-plate-recognition-multiline-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/inference/get-started-demo-ocr-custom.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/inference/custom-options-model-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/inference/get-started-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/inference/get-started-tiny-demo.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/inference/number-plate-filling.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/inference/get-started-demo-ocr-custom.ipynb
# test python benchmarks examples
python examples/py/benchmark/accuracy-test.py
python examples/py/benchmark/runtime-test.py
python tutorials/py/benchmark/accuracy-test.py
python tutorials/py/benchmark/runtime-test.py
# test jupyter benchmarks examples
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/benchmark/accuracy-test.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/benchmark/accuracy-test-custom.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/benchmark/accuracy-test-multiline.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/benchmark/runtime-test.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/benchmark/runtime-test-multiline.ipynb
# test jupyter dataset tools examples
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/dataset_tools/analyze_via_dataset.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/dataset_tools/auto_number_grab.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/dataset_tools/check_ocr_model.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/dataset_tools/option_checker.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html examples/ju/dataset_tools/ocr_dataset_format_checker.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/benchmark/accuracy-test.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/benchmark/accuracy-test-custom.ipynb
jupyter nbconvert --ExecutePreprocessor.timeout=6000 --execute --to html tutorials/ju/benchmark/runtime-test.ipynb
# test image loaders
python3 nomeroff_net/image_loaders/base.py
Expand All @@ -140,9 +107,6 @@ jobs:
# test nnmodels
python3 -m nomeroff_net.nnmodels.numberplate_classification_model -f nomeroff_net/nnmodels/numberplate_classification_model.py
python3 -m nomeroff_net.nnmodels.numberplate_options_model -f nomeroff_net/nnmodels/numberplate_options_model.py
python3 -m nomeroff_net.nnmodels.fraud_numberpate_model -f nomeroff_net/nnmodels/fraud_numberpate_options.py
python3 -m nomeroff_net.nnmodels.numberplate_inverse_model -f nomeroff_net/nnmodels/numberplate_inverse_model.py
python3 -m nomeroff_net.nnmodels.numberplate_orientation_model -f nomeroff_net/nnmodels/numberplate_orientation_model.py
python3 -m nomeroff_net.nnmodels.ocr_model -f nomeroff_net/nnmodels/ocr_model.py
# test tools
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,16 @@ This gives you the opportunity to get **99% accuracy**on photos that are uploade

<img src="https://nomeroff.net.ua/images/nn/ocr_example.png" alt="Nomeroff-Net OCR Example"/>


## Contributing
Contributions to this repository are welcome. Examples of things you can contribute:
* Training on other datasets.
* Accuracy Improvements.

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=ria-com/nomeroff-net&type=Date)](https://star-history.com/#ria-com/nomeroff-net&Date)

## Credits
* Dmytro Probachay &lt;dmytro.probachay@ria.com&gt;
* Oleg Cherniy &lt;oleg.cherniy@ria.com&gt;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"tags":[],"objects":[],"state_id":"2","region_id":"11","size":{"width":146,"height":31},"moderation":{"isModerated":1,"moderatedBy":"Andrei Dziaineka"},"description":"2914 KC-7","name":"10001_2914KC7_0","count_lines":"1"}
{"tags":[],"objects":[],"state_id":"2","region_id":"11","size":{"width":146,"height":31},"moderation":{"isModerated":1,"moderatedBy":"Andrei Dziaineka"},"description":"2914KC7","name":"10001_2914KC7_0","count_lines":"1"}
1 change: 0 additions & 1 deletion tutorials/ju/benchmark/runtime-test.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@
"print(f\"One photo process {timer_stat['NumberPlateDetectionAndReadingRuntime.call']} seconds\")\n",
"print()\n",
"print(f\"detect_bbox_time_all {timer_stat['NumberPlateLocalization.call']} per one photo\")\n",
"print(f\"craft_time_all {timer_stat['NumberPlateKeyPointsDetection.call']} per one photo\")\n",
"print(f\"classification_time_all {timer_stat['NumberPlateClassification.call']} per one photo\")\n",
"print(f\"ocr_time_all {timer_stat['NumberPlateTextReading.call']} per one photo\")"
]
Expand Down
4 changes: 2 additions & 2 deletions tutorials/ju/train/ocr/eu.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -241,7 +241,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.10"
"version": "3.9.18"
}
},
"nbformat": 4,
Expand Down
1 change: 0 additions & 1 deletion tutorials/py/benchmark/runtime-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def main(pipeline_name, image_loader_name, images_glob,
print(f"One photo process {timer_stat['NumberPlateDetectionAndReadingRuntime.call']} seconds")
print()
print(f"detect_bbox_time_all {timer_stat['NumberPlateLocalization.call']} per one photo")
print(f"craft_time_all {timer_stat['NumberPlateKeyPointsDetection.call']} per one photo")
print(f"classification_time_all {timer_stat['NumberPlateClassification.call']} per one photo")
print(f"ocr_time_all {timer_stat['NumberPlateTextReading.call']} per one photo")

Expand Down
3 changes: 2 additions & 1 deletion tutorials/py/inference/get-started-tiny-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
from nomeroff_net.tools import unzip

if __name__ == '__main__':
number_plate_detection_and_reading = pipeline("number_plate_detection_and_reading_tiny", image_loader="opencv")
number_plate_detection_and_reading = pipeline("number_plate_detection_and_reading", image_loader="opencv",
upscaling=False)

result = number_plate_detection_and_reading([
os.path.join(nomeroff_net_dir, './data/examples/oneline_images/example1.jpeg'),
Expand Down

0 comments on commit b279baa

Please sign in to comment.