Coder Social home page Coder Social logo

efficientdet's Introduction

Python

Use v3.8 wget https://www.python.org/ftp/python/3.9.11/Python-3.9.11.tar.xz xz -d Python-3.9.11.tar.xz tar -xvf Python-3.9.11.tar cd Python-3.9.11 sudo apt install
libffi-dev
libgl1
libsqlite3-dev
libssl-dev
-y ./configure make -j12 sudo make altinstall

EfficientDet

Repository with my implementation of EfficientDet.

CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.file)")) CUPTI_PATH=/usr/local/cuda-12.2/targets/x86_64-linux/lib/ export LD_LIBRARY_PATH=$CUDNN_PATH/lib:$CUPTI_PATH:$LD_LIBRARY_PATH python3 -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"

Ubuntu

sudo sh cuda_12.2.2_535.104.05_linux.run

Driver: Not Selected Toolkit: Installed in /usr/local/cuda-12.2/

Please make sure that

  • PATH includes /usr/local/cuda-12.2/bin
  • LD_LIBRARY_PATH includes /usr/local/cuda-12.2/lib64, or, add /usr/local/cuda-12.2/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-12.2/bin ***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 535.00 is required for CUDA 12.2 functionality to work. To install the driver using this installer, run the following command, replacing with the name of this run file: sudo .run --silent --driver

Training checklist

  1. Check your data annotation datacheck.py
  2. Measure how to set anchor boxes anchor_histogram.py, modify model/anchors.py at aspects and areas.

CustomOp

Object detection z tflite model maker: síť má na konci vrstvu TFLite_Detection_PostProcess, která je build-in v tflite. Podívej se na tensorflow/tensorflow/lite/kernels/register.cc.

TFLite_Detection_PostProcess je zřejmně kompatibilní s EdgeTPU compiler, ale neobsahuje extrakci sin/cosine, kterou potřebuji pro rotaci blade v Edwards.

Sít je typu SSD. Na výstupu má surové [x1, x2, y1, y2, sin, cos, class logits], kde x, y, jsou offset a scale Anchorů a class logits je také třeba dále zpravovat na třídu a score.

Existují dvě strategie:

  1. Add post processing layer like TFLite_Detection_PostProcess, but it lacks angle. Adding custom-op is not supported in edgetpu_compiler resulting to error
Edge TPU Compiler version 16.0.384591198
Started a compilation timeout timer of 180 seconds.
ERROR: Encountered unresolved custom op: Atan.
ERROR: Node number 1 (Atan) failed to prepare.

Compilation failed: Model failed in Tflite interpreter. Please ensure model can be loaded/run in Tflite interpreter.
Compilation child process completed within timeout period.
Compilation failed! 
  1. Do post processing in custom c++ code as we did that for palm and landmark detection. Anchors need to be generated in c++ and kept in sync with python training code manually.

Reference

Better rotation representations for accurate pose estimation

Inspiration

By tflite model maker /home/jiri/custom_model_maker/examples/tensorflow_examples/lite/model_maker/pip_package/src/tensorflow_examples/lite/model_maker/third_party/efficientdet/keras/postprocess.py

See comments in def postprocess_tflite(params, cls_outputs, box_outputs):

https://keras.io/examples/vision/retinanet/

Rotation

/home/jiri/EfficientDet/model/rotation.py in line 7 40 # %% 41 # see 42 # [1] https://www.tensorflow.org/api_docs/python/tf/linalg/matmul 43 # [2] https://math.stackexchange.com/questions/744736/rotation-matrix-to-axis-angle 45 a = 10.0 / 180.0 * 3.14 ----> 46 R = Rx(0.0) @ Ry(0.0) @ Rz(0.0) # if label rotation 47 Q = Rx(0.0) @ Ry(0.0) @ Rz(a) # and predicted rotation differ by angle a 49 QT = tf.transpose(Q)

Mount windows partition into Ubuntu

mkdir -p ~/winpart
jiri@jiri-81Y6:~/EfficientDet$ lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0         7:0    0     4K  1 loop /snap/bare/5
loop1         7:1    0  55.7M  1 loop /snap/core18/2785
loop2         7:2    0  55.7M  1 loop /snap/core18/2790
loop3         7:3    0  63.4M  1 loop /snap/core20/1974
loop4         7:4    0  63.5M  1 loop /snap/core20/2015
loop5         7:5    0  73.9M  1 loop /snap/core22/858
loop6         7:6    0  73.9M  1 loop /snap/core22/864
loop7         7:7    0 240.5M  1 loop /snap/firefox/3206
loop8         7:8    0 238.8M  1 loop /snap/firefox/3252
loop9         7:9    0 218.4M  1 loop /snap/gnome-3-34-1804/93
loop10        7:10   0 485.5M  1 loop /snap/gnome-42-2204/126
loop11        7:11   0   497M  1 loop /snap/gnome-42-2204/141
loop12        7:12   0  91.7M  1 loop /snap/gtk-common-themes/1535
loop13        7:13   0 115.7M  1 loop /snap/slack/105
loop14        7:14   0 113.3M  1 loop /snap/slack/89
loop15        7:15   0  12.3M  1 loop /snap/snap-store/959
loop16        7:16   0  40.8M  1 loop /snap/snapd/20092
loop17        7:17   0  40.9M  1 loop /snap/snapd/20290
loop18        7:18   0   452K  1 loop /snap/snapd-desktop-integration/83
loop19        7:19   0 320.4M  1 loop /snap/vlc/3078
nvme1n1     259:0    0   1.8T  0 disk 
├─nvme1n1p1 259:1    0   100M  0 part 
├─nvme1n1p2 259:2    0    16M  0 part 
├─nvme1n1p3 259:3    0   1.8T  0 part <<=== for example this big drive on Legion5 of (jiri)
└─nvme1n1p4 259:4    0   530M  0 part 
nvme0n1     259:5    0 465.8G  0 disk 
├─nvme0n1p1 259:6    0 209.8G  0 part 
├─nvme0n1p2 259:7    0     1G  0 part /boot/efi
└─nvme0n1p3 259:8    0   255G  0 part /var/snap/firefox/common/host-hunspell
  1. read-only access
sudo mount -t ntfs -o ro /dev/nvme1n1p3 ~/winpart
  1. read-write access
sudo mount -t ntfs /dev/nvme1n1p3 ~/winpart

Known issues

  • Access is denied because the NTFS volume is already exclusively opened use lsblk to check if the partition is already mounted, if so use
sudo umount /media/jiri/D6667DDE667DBFB3 (or whatever after /jiri/...)

efficientdet's People

Contributors

jiri-kula avatar flash10042 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.