'프로그램 사용'에 해당되는 글 2258건

  1. 2022.02.07 edgetpu_c.h 파일 내용 분석
  2. 2022.02.07 tensorflow brace-enclosed initializer list 4
  3. 2022.01.27 tflite bazel rpi3b+
  4. 2022.01.27 bazel cross compile
  5. 2022.01.27 google coral, tpu yolo
  6. 2022.01.26 rfb(remote framebuffer) protocol
  7. 2022.01.25 meson (빌드 시스템)
  8. 2022.01.25 coral tpu delegate example
  9. 2022.01.24 mp4 복구 시도
  10. 2022.01.24 wayvnc

 

2020년 1월 30일 커밋 되었는데

헤더에 사용법을 넣어두었고 그게 바로.. 문제의 그 내용 -_-

// 4. Modify interpreter with the delegate.
//
// auto* delegate =
//     edgetpu_create_delegate(device.type, device.path, nullptr, 0);
// interpreter->ModifyGraphWithDelegate({delegate, edgetpu_free_delegate});


// Frees delegate returned by `edgetpu_create_delegate`.
EDGETPU_EXPORT void edgetpu_free_delegate(TfLiteDelegate* delegate);

[링크 : https://github.com/google-coral/edgetpu/blob/master/libedgetpu/edgetpu_c.h]

 

delegate를 free 하지 않고(메모리 누수를 감수하면..)

위의 함수 원형으로 delegate만 던져주거나

unique_ptr <Delegate, Deleter > 로 랩핑하면 가능을 할 것 같은데

그게 아니라면..  { } 로 감싼 부분이 자동으로 변형되는건 아니겠지? (컴파일러 옵션에 의해)

TfLiteStatus ModifyGraphWithDelegate(
  TfLiteDelegate *delegate
)

TfLiteStatus ModifyGraphWithDelegate(
  std::unique_ptr< Delegate, Deleter > delegate
)

[링크 : https://www.tensorflow.org/lite/api_docs/cc/class/tflite/interpreter#modifygraphwithdelegate_1]

'프로그램 사용 > google coral' 카테고리의 다른 글

google coral with tpu, cpp  (4) 2022.02.07
google coral with tpu, python  (0) 2022.02.07
tensorflow brace-enclosed initializer list  (4) 2022.02.07
google coral, tpu yolo  (0) 2022.01.27
coral tpu delegate example  (0) 2022.01.25
Posted by 구차니

그냥 손에 익숙한(!) v2.4.1을 써서 그런가(구버전 api라서?)

해당 함수가 존재하지 않는다고 에러가 발생하고 빌드에 실패한다.

classify.cc:177:73: error: no matching function for call to ‘tflite::Interpreter::ModifyGraphWithDelegate(<brace-enclosed initializer list>)’
   interpreter->ModifyGraphWithDelegate({delegate, edgetpu_free_delegate});
                                                                         ^
In file included from classify.cc:12:
/home/pi/work/coral/tensorflow/tensorflow/lite/interpreter.h:421:16: note: candidate: ‘TfLiteStatus tflite::Interpreter::ModifyGraphWithDelegate(TfLiteDelegate*)’
   TfLiteStatus ModifyGraphWithDelegate(TfLiteDelegate* delegate);
                ^~~~~~~~~~~~~~~~~~~~~~~
/home/pi/work/coral/tensorflow/tensorflow/lite/interpreter.h:421:16: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘TfLiteDelegate*’
/home/pi/work/coral/tensorflow/tensorflow/lite/interpreter.h:431:23: note: candidate: ‘template<class Delegate, class Deleter> TfLiteStatus tflite::Interpreter::ModifyGraphWithDelegate(std::unique_ptr<_Tp, _Dp>)’
   inline TfLiteStatus ModifyGraphWithDelegate(
                       ^~~~~~~~~~~~~~~~~~~~~~~
/home/pi/work/coral/tensorflow/tensorflow/lite/interpreter.h:431:23: note:   template argument deduction/substitution failed:
classify.cc:177:73: note:   couldn't deduce template parameter ‘Delegate’
   interpreter->ModifyGraphWithDelegate({delegate, edgetpu_free_delegate});

 

검색해보니 c++x00

 

class Example {
  private:
  public:
    Example(std::initializer_list<int> list) {
    }
};

Example exam = {10,10,10,10,10};

[링크 : https://forum.arduino.cc/t/how-to-make-brace-enclosed-initializer-list-constructor/628295]

 

Phenotype(std::initializer_list<uint8> c) {
  assert(c.size() <= std::size(m_array));
  std::copy(c.begin(), c.end(), m_array);
}

// used like
Phenotype p1{1, 2, 3};
Phenotype p2({1, 3, 2}); // works too
Phenotype p3(1, 2, 3); // doesn't work

[링크 : https://stackoverflow.com/questions/4118025/brace-enclosed-initializer-list-constructor]

 

그나저나 api 문서가 업데이트 늦을수도 있지만

아래의 원형밖에 없는데 std::unique_ptr이 std::initializer_list일 리는 없을테고. 도대체 어떤 함수를 써야 하는걸까?

TfLiteStatus ModifyGraphWithDelegate(
  TfLiteDelegate *delegate
)

TfLiteStatus ModifyGraphWithDelegate(
  std::unique_ptr< Delegate, Deleter > delegate
)

TfLiteStatus ModifyGraphWithDelegate(
  std::unique_ptr< TfLiteDelegate > delegate
)=delete

[링크 : https://www.tensorflow.org/lite/api_docs/cc/class/tflite/interpreter#modifygraphwithdelegate_1]

'프로그램 사용 > google coral' 카테고리의 다른 글

google coral with tpu, python  (0) 2022.02.07
edgetpu_c.h 파일 내용 분석  (0) 2022.02.07
google coral, tpu yolo  (0) 2022.01.27
coral tpu delegate example  (0) 2022.01.25
google coral, ubuntu 18.04  (0) 2020.10.20
Posted by 구차니

요약하면.. 메모리 부족하니 빌드 속도를 포기하고 swap을 이용해서 커버치기!

[링크 : https://gist.github.com/EKami/9869ae6347f68c592c5b5cd181a3b205]

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

tensorflow lite / mnist 학습  (0) 2024.01.02
yolo-label  (0) 2022.03.22
bazel cross compile  (0) 2022.01.27
bazel clean  (0) 2021.10.19
2.7.0-rc with opencl  (0) 2021.10.13
Posted by 구차니

'프로그램 사용 > yolo_tensorflow' 카테고리의 다른 글

yolo-label  (0) 2022.03.22
tflite bazel rpi3b+  (0) 2022.01.27
bazel clean  (0) 2021.10.19
2.7.0-rc with opencl  (0) 2021.10.13
tf release 2.7.0-rc  (0) 2021.10.12
Posted by 구차니

'프로그램 사용 > google coral' 카테고리의 다른 글

edgetpu_c.h 파일 내용 분석  (0) 2022.02.07
tensorflow brace-enclosed initializer list  (4) 2022.02.07
coral tpu delegate example  (0) 2022.01.25
google coral, ubuntu 18.04  (0) 2020.10.20
google coral  (0) 2020.10.06
Posted by 구차니
프로그램 사용/VNC2022. 1. 26. 17:07

'프로그램 사용 > VNC' 카테고리의 다른 글

libvncserver 마우스 이벤트  (0) 2022.02.25
libvncserver 사용예  (0) 2022.02.15
gconf-editor / ubuntu 14.04 LTS vino + VNC 접속불가  (0) 2015.03.22
VNC web 버전?  (0) 2014.12.11
VNC 5.0.5  (0) 2013.09.04
Posted by 구차니
프로그램 사용/meson2022. 1. 25. 15:04

 

 

[binaries]
c = '/usr/lib/ccache/arm-linux-gnueabihf-gcc'
cpp = '/usr/lib/ccache/arm-linux-gnueabihf-g++'
ar = '/usr/bin/arm-linux-gnueabihf-ar'
strip = '/usr/bin/arm-linux-gnueabihf-strip'
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
 
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'armv8hl'
endian = 'little'
meson build/ \
    --cross-file=$HOME/pi/mesa/cross_file

[링크 : https://makersweb.net/qt/17557]

 

ubuntu 에서 apt install meson 으로 설치시 구버전이라 발생하는 에러

meson_options.txt:1:0: ERROR:  Unknown type feature.

[링크 : https://github.com/swaywm/wlroots/issues/1258]

 

Ninja는 속도에 중점을 둔 소형 빌드 시스템으로, Make의 느린 증분 빌드의 대안으로 만들어졌습니다.

[링크 : https://int-i.github.io/cpp/2021-06-26/cpp-meson/]

Posted by 구차니

cpp

[링크 : https://github.com/google-coral/tflite]

[링크 : https://coral.ai/docs/edgetpu/tflite-cpp/]

 

 

python

[링크 : https://coding-yoon.tistory.com/91]

 

+

auto* delegate = edgetpu_create_delegate(device.type, device.path, nullptr, 0);
  interpreter->ModifyGraphWithDelegate({delegate, edgetpu_free_delegate});

[링크 : https://github.com/google-coral/tflite/blob/master/cpp/examples/classification/classify.cc]

 

auto delegates = delegate_providers.CreateAllDelegates();
  for (auto& delegate : delegates) {
    const auto delegate_name = delegate.provider->GetName();
    if (interpreter->ModifyGraphWithDelegate(std::move(delegate.delegate)) !=
        kTfLiteOk) {
      LOG(ERROR) << "Failed to apply " << delegate_name << " delegate.";
      exit(-1);
    } else {
      LOG(INFO) << "Applied " << delegate_name << " delegate.";
    }
  }

[링크 : https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/label_image/label_image.cc]

 

'프로그램 사용 > google coral' 카테고리의 다른 글

edgetpu_c.h 파일 내용 분석  (0) 2022.02.07
tensorflow brace-enclosed initializer list  (4) 2022.02.07
google coral, tpu yolo  (0) 2022.01.27
google coral, ubuntu 18.04  (0) 2020.10.20
google coral  (0) 2020.10.06
Posted by 구차니

h.264 코덱으로 된 녀석이라 데이터 부분만 빼내서 ffmpeg 거치면 재생이 가능할줄 알았는데 무리인가?

 

[링크 : https://video.stackexchange.com/questions/29073]

[링크 : https://codecpack.co/download/recover-mp4.html]

[링크 : https://stackoverflow.com/questions/19300350]

 

+

2022.02.14

복구 성공!

 

동일 기기에서 촬영된 정상 동영상과 복구할 동영상이 필요함

1. 정상 동영상에서 부터 무언가를 추출

C:\> recover_mp4.exe good.mp4 --analyze
/// 중략
Now run the following command to start recovering:
recover_mp4.exe corrupted_file result.h264 --noaudio --ext

Then use ffmpeg to mux the final file:
ffmpeg.exe -r 12.097 -i result.h264 -c:v copy result.mp4

 

2. 비정상 동영상으로 부터 h264 만 추출

위에서 알려준 옵션대로 처리해야 복구가 진행된다.

C:\> recover_mp4.exe corrupted_file result.h264 --noaudio --ext
// 중략
skip: 0x001C02C5 [0x       6] ???           {00 00 00 02 09 F0}
H264: 0x001C02CB [0x    15CA] -> 0x  1BF903 {41 9B A0 14} P frame
%100.000
Complete!
H264 non-IDR NAL unit size: Min 0x4, Avg 0x1289, Max 0x366C
Video=99.864
'result.h264' created, size 1838797 (99.864%)

 

3. 복구 데이터를 이용해서(아마도 h.264 스트림?) mp4로 변환

-r 뒤의 숫자는 framerate 니까 굳이 안 넣어 주면 원본의 속도로 복구 된다. (안되면 넣어주는게 좋을 듯)

C:\> ffmpeg.exe -r 30 -i result.h264 -c:v copy recovered.mp4
Input #0, h264, from 'result.h264':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(progressive), 800x480, 25 fps, 25 tbr, 1200k tbn
Output #0, mp4, to 'recovered.mp4':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 800x480, q=2-31, 25 fps, 25 tbr, 15360 tbn
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0000020bce548780] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
frame=  363 fps=0.0 q=-1.0 Lsize=    1798kB time=00:00:12.06 bitrate=1220.7kbits/s speed=2.16e+03x
video:1796kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.130085%

[링크 : https://blog.naver.com/winsweet/222340783544]

[링크 : http://slydiman.me/eng/mmedia/recover_mp4.htm]

[링크 : https://restore.media/blog/how-to-fix-corrupted-mp4-files]

Posted by 구차니
프로그램 사용/wayland2022. 1. 24. 16:55

아놔.. rdp랑 동일하네.. wayland 자체가 현재 사용중인 세션은 어떻게든 끌어갈 수 없는 구조인가?

This is a VNC server for wlroots-based Wayland compositors (⛔ Gnome and KDE are not supported). It attaches to a running Wayland session, creates virtual input devices, and exposes a single display via the RFB protocol. The Wayland session may be a headless one, so it is also possible to run wayvnc without a physical display attached.

[링크 : https://github.com/any1/wayvnc]

 

As of 2020, there are several projects that use these methods to provide GUI access to remote computers. The compositor Weston provides an RDP backend. GNOME has a remote desktop server that supports VNC. WayVNC is a VNC server that works with compositors, like Sway, based on the wlroots library. Waypipe works with all Wayland compositors and offers almost-transparent application forwarding, like ssh -X.

[링크 : https://wayland.freedesktop.org/faq.html]

 

느리긴 해도 라즈베리 파이 3 에서도 돌아가긴 한다는 건가?

New features since v0.1.2:
  • The OpenGL ES 2.0 based renderer has now been replaced with a pixman based
    renderer. The new renderer is both simpler and performs better on devices
    with poor memory bandwidth such as the Raspberry Pi 3.

[링크 : https://github.com/any1/wayvnc/releases]

[링크 : https://github.com/any1/neatvnc#client-compatibility]

'프로그램 사용 > wayland' 카테고리의 다른 글

wayland-scanner  (0) 2022.02.16
wayland wl_fixed_t 변수  (0) 2022.02.07
weston client 메모리 누수  (0) 2022.01.17
wayland buffer  (0) 2022.01.13
wayland client example  (0) 2022.01.06
Posted by 구차니