크롬에서 미디어를 재생시키려면 mp4 확장자로 해야하고, (avi는 다운로드가 되는 불상사가 발생) opencv에서는 mp4를 VideoWriter를 하고자 하면 보통 코덱을 'mp4v'로 아래와 같이 설정한다. fourcc = cv2.VideoWriter_fourcc(*'mp4v') 하지만 슬프게도 mp4v 코덱은 웹에서 플레이가 안 되므로, fourcc = cv2.VideoWriter_fourcc(*'h264') or fourcc = cv2.VideoWriter_fourcc(*'x264') 등으로 시도를 해서 많이들 해결 하는데, 나 같은 경우에는 OpenCV4로 버전을 다시 빌드해줘도 해결이 안 되서 아침 내내 삽질을 했다. 그래서 로그 화면이 더러워져도... ffmpeg를 설지한 다음, 영상을 변..
공부하는삶
설치 순서(elastic 8.0) wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.0.0-linux-x86_64.tar.gz wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.0.0-linux-x86_64.tar.gz.sha512 shasum -a 512 -c elasticsearch-8.0.0-linux-x86_64.tar.gz.sha512 tar -xzf elasticsearch-8.0.0-linux-x86_64.tar.gz cd elasticsearch-8.0.0/ 실행 ./bin/elasticsearch ✅ Elasticsearch ..
array : data type = homogeneous / sequence data type. 같은 종류의 순서가 있는 데이터. 프로그래밍 용어 => indexing, slicing, sequence operatoration 가능함 sequence operatoration? x = [1, 2, 3] x + x >> [1, 2, 3, 1, 2, 3] 'abc' + 'bcd' >> 'abcbcd' 3*'abc' >> 'abcabcabc' Tensorflow에서 Operator overloading ? 원래 array + array = 뒤에서 붙어주는 연산인데 tensorflow에서는 vectorization으로 지원해줌 vectorization연산? elementwise방식으로 loop 없이 동시에 여러번..
Focus not on constructing a data collection but rather on describing "what" that data collection consists of. Encapsulation One obvious way of focusing more on "what" than "how" is simply to refactor code, and to put the data construction in a more isolated place-i.e., in a function or method #configure the data to start with collection = get_initial_state() state_var = None for datum in data_se..
Composite pattern의 활용 composite pattern 중 하나의 속성은 inheritance를 대신 할 수 있음 class A: class C: class B: def __init__(self): self.a = A() self.c = B() def multi(self): return self.a * self.b class AA: a = 1 def aaaa(slef, x): self.b = x def aaa(self): return self.b class BB(AA): pass 상속의 문제점 : AA와 coupling. 밀접하게 연결이 되어 있어서, class AA가 바뀌면 class BB의 기능도 바뀌어짐. class CC: ## AA가 변할 때 같이 안 변함 a = 1 # overi..
Feature space Feature Space Feature Space란, 정의한 feature의 N 차원으로 정의됨. 만약에 2개의 feature를 정의하였으면 2차원으로 정의됩니다. 다만, target label은 포함되지 않습니다. Feature Space coverage feature space coverage는 매우 중요합니다. train과 evalutation을 위한 데이터의 예시는, 대표성을 띄어야 하니다. 즉, 모델에 전달될 requests와 이 requests가 feature space에 있는 경우 해당 feature space의 영역도 model을 train하거나 evaluation할 때 다뤄야 합니다. 동일한 classes에 대한 동일한 차원 image data에 대한 비슷한 특성..