STUDY/Solution 7

[Python] 알고리즘 코드 상에서, 시간과 메모리 측정하기

i) 알고리즘에서 시간을 측정하는 작업을 사용하고 싶을 때, import time start = time.time() # 코드 작성 end = time.time() print("time : ", end - start) example. 백준 14888 # import sys import time start = time.time() n = int(input()) num = list(map(int, input().split())) op = list(map(int, input().split())) minN = int(1e9) maxN = int(-1e9) def f(c, v): global minN, maxN if c == n: if minN > v: minN = v if maxN < v: maxN = v el..

STUDY/Solution 2023.01.03

[OpenCV] cv2.imwrite 까맣게 사진이 저장되는 이유

딥러닝 모델을 돌리고 인풋 적용 후 결과 이미지를 저장하는 데 계속 까만 사진으로 저장이 되었다 .. -> 정규화가 안되있던 것 (정규화 : 특정 부분에 몰려 있는 값을 전체 영역으로 골고루 분포하게 하도록 만듦) imgs = np.expand_dims(load_net_in(INPUT_IMG_FNAME, desired_size=INPUT_SIZE), axis=0) ys = model.predict(imgs) y = postprocess(ys)[0] save_file = "x" + str(j) + ".jpg" y = cv2.cvtColor(y, cv2.COLOR_BGR2RGB) y = cv2.normalize(y, None, 0, 255, cv2.NORM_MINMAX, dtype=cv2.CV_8U) # 이..

STUDY/Solution 2022.09.27

[Android Studio] naver map api - 위치 클릭 시 위경도, 도로명 주소 출력

@Override public void onMapReady(@NonNull NaverMap naverMap) { this.mNaverMap = naverMap; Marker marker = new Marker(); naverMap.setLocationSource(mLocationSource); // 지도 클릭 이벤트 처리 naverMap.setOnMapClickListener((point, coord) -> { // 클릭한 위치의 위경도 : coord.latitude, coord.longitud marker.setPosition(new LatLng(coord.latitude, coord.longitude)); marker.setMap(naverMap); // 위경도로 도로명 주소 변환 g = new Ge..

STUDY/Solution 2022.08.31