데이비드최
@nexthumans
수강생
153
수강평
15
강의 평점
4.9
현재 대기업 중심으로 아래와 같은 프로젝트의 개발책임 및 컨설팅을 맡고 있습니다. 현역^^입니다.
더불어, 고려대 대학원에서 인공지능 관련 겸임교수로도 활동하고 있습니다.
저의 목표는 실전에 바로 써먹을 수 있는 현장감 있는 프로그래밍 기술입니다. 앞으로 많은 여러분과 함께 재미난 수업 만들어 나가고 싶습니다.
엔터프라이즈 인공지능 구조 및 서비스 설계
머신러닝 서비스 구현
벡엔드 서비스 개발
클라우드(Azure) Databricks, ETL, Fabric 등 각종 클라우드 환경에서의 데이터베이스 구축 및 서비스 개발
강의
수강평
- 진짜 현장에서 통하는 OCR, 이렇게 만듭니다.
- 컴퓨터 비전 이상 탐지, 개발부터 배포까지 올인원 마스터
- 컴퓨터 비전 이상 탐지, 개발부터 배포까지 올인원 마스터
- 컴퓨터 비전 이상 탐지, 개발부터 배포까지 올인원 마스터
게시글
질문&답변
강의 코드 요청 및 질문
강의에 적용된 모델은 "정상/붕량'을 이진 분류하는 구조로 설계되어 있어, "이 샘플이 이상하다/아니다"를 판단합니다.질문 하신 것처럼 불량영역을 박스(ROI)로 표시하려면, 분류 모델이 아니라,Object Detection(객체 탐지) 모델(예, YOLO, Faster R-CNN 계열)이나Segmentation(분할)기반 불량 영역 탐지 모델(예: U-Net 계열, anomaly segmentation)으로 설계를 바꾸고, 각 불량 영역에 대해 Bounding Box나 마스크 라벨을 다시 구축하는 작업이 필요해요.만약 추가 라벨링 없이 '대략적인 불량 위치'를 보고 싶은 것이라면,현재 분류 모델의 feature map 을 활용한Grad-CAM / Class Activation Map(CAM) 과 같은 기법으로 heatmap 형태의 시각화는 비교적 빠르게 검토가 가능해요. 다만, 이 방식은 정확한 박스 표시라기보다는 '의심 구역 강조'에 가까워요.도움이 되었길 바랍니다. 강의코드는 이메일로 보내드렸습니다. 열공하세요~
- 0
- 2
- 18
질문&답변
수업 자료 요청입니다
이메일로 메일 한 통 보내주세요~ 바로 보내드리도록 할게요.
- 0
- 1
- 24
질문&답변
end point 생성 관련 질문드립니다!
"패치 업데이트 강의" 섹션을 추가해서 해당 질문에 대한 대처방법을 올려두었습니다.앞선 답변이 부족하면 영상을 참고하시기 바랍니다. 그럼 열공하세요~
- 0
- 4
- 72
질문&답변
체험 계정에서는 End-point 생성이 안 되는걸까요?
"패치 업데이트 강의" 섹션을 추가해서 해당 질문에 대한 대처방법을 올려두었습니다.앞선 답변이 부족하면 영상을 참고하시기 바랍니다. 그럼 열공하세요~
- 0
- 2
- 63
질문&답변
end point 생성 관련 질문드립니다!
원인을 파악했습니다.Databricks 측에서 기존의 legacy serving 을 없애고 새롭게 Mosaic AI Model Serving 으로 정책을 바꾸면서, 사용자의 ML/DL 모델은 물론, LLM 모델들을 한 곳에서 모두 Serverless Model Serving 을 하도록 해 놓았네요.찾아보니, 기존에 serving 으로 올려놓은 모델들이 run_id 가 그대로 살아 있음에도 불구하고 endpoint 를 종전처럼 이용할 수 없게 바꾸어 놓았습니다. 아쉬운 점은 Mosaic AI Model Serving 이 유료라는 점이네요.https://www.databricks.com/product/pricing/model-serving 그렇기에 유료 계정으로 사용하고 있으니 create endpoint 가 동작하지 않을 거예요. pricing 을 확인해 보면 비용은 매우 저렴한 편이라 학습용으로 약간 이용하는 수준이라면 부담은 없을 것으로 보여요. serverless serving 이 특징이다보니, create endpoint 를 누르면 container 레지스트리가 생성되며 REST API로 엔드포인트가 제공되어, 종전보다 훨씬 편하게 모델을 이용할 수 있다는 점이 가장 큰 장점입니다.
- 0
- 4
- 72
질문&답변
end point 생성 관련 질문드립니다!
데이터브릭스가 업데이트되면서 발생하는 현상인것 같은데요, 확인해보고 연락드리도록 할게요~
- 0
- 4
- 72
질문&답변
이미지 노이즈 추가하는 코드 공유 부탁드립니다.
안녕하세요~많이 답답하셨겠네요.필요하신 코드를 공유합니다~import numpy as np import matplotlib.pyplot as plt from PIL import Image, ImageDraw from pathlib import Path def load_image(file_path: Path) -> np.array: """ Load an image from a given file path and convert it to a NumPy array. Args: file_path (Path): Path to the image file. Returns: np.array: The image as a NumPy array. """ pil_image = Image.open(file_path) return np.array(pil_image) def add_irregular_patch(noisy_image: np.array, patch_pixels: int, noise_value: int) -> np.array: """ Adds an irregular, polygonal noise patch to the image. Args: noisy_image (np.array): The image array to modify. patch_pixels (int): Approximate area of the noise patch in pixels. noise_value (int): Noise value (255 for salt, 0 for pepper). Returns: np.array: The modified image with the noise patch added. """ img_pil = Image.fromarray(noisy_image) draw = ImageDraw.Draw(img_pil) img_width, img_height = img_pil.size # Estimate an average radius from the patch area (area ≈ πr²) r = int(np.sqrt(patch_pixels / np.pi)) r = max(r, 5) # Ensure a minimum patch size # Choose a random center where the patch can fit center_x = np.random.randint(r, img_width - r) center_y = np.random.randint(r, img_height - r) # Random number of vertices for the irregular polygon num_points = np.random.randint(5, 10) angles = np.linspace(0, 2 * np.pi, num_points, endpoint=False) angles += np.random.uniform(0, 2 * np.pi / num_points, size=num_points) # Generate random radii for each vertex around the average radius radii = np.random.uniform(0.5 * r, 1.5 * r, size=num_points) # Create the polygon points points = [ (int(center_x + radius * np.cos(angle)), int(center_y + radius * np.sin(angle))) for angle, radius in zip(angles, radii) ] # Set the fill color based on image mode fill_color = (noise_value, noise_value, noise_value) if img_pil.mode == 'RGB' else noise_value draw.polygon(points, fill=fill_color) return np.array(img_pil) def random_patch_areas(total: int, num_patches: int) -> np.array: """ Split the total noise area into a random distribution of patch areas that sum to total. Args: total (int): Total number of noisy pixels for this noise type. num_patches (int): Number of patches. Returns: np.array: Array of patch areas. """ areas = np.random.rand(num_patches) areas = areas / areas.sum() # Normalize so areas sum to 1 areas = (total * areas).astype(int) # Adjust in case of rounding issues diff = total - areas.sum() areas[0] += diff return areas def apply_random_irregular_noise(image: np.array, amount: float, salt_vs_pepper: float) -> np.array: """ Applies random irregular noise patches (both salt and pepper) to an image. Args: image (np.array): The original image. amount (float): Fraction of total image pixels to be noised. salt_vs_pepper (float): Fraction of noise that is salt (white). Returns: np.array: The noisy image. """ noisy = image.copy() total_pixels = image.shape[0] * image.shape[1] num_pixels = int(amount * total_pixels) # Calculate noise areas for salt and pepper num_salt = int(salt_vs_pepper * num_pixels) num_pepper = num_pixels - num_salt # Randomly determine number of patches (e.g., 1 to 3 patches) num_salt_patches = np.random.randint(1, 10) num_pepper_patches = np.random.randint(1, 10) # Split the noise area into patch areas salt_patch_areas = random_patch_areas(num_salt, num_salt_patches) pepper_patch_areas = random_patch_areas(num_pepper, num_pepper_patches) # Add salt noise patches for area in salt_patch_areas: noisy = add_irregular_patch(noisy, area, 255) # Add pepper noise patches for area in pepper_patch_areas: noisy = add_irregular_patch(noisy, area, 0) return noisy def plot_images(original: np.array, noisy: np.array) -> None: """ Plots the original and noisy images side by side. Args: original (np.array): The original image. noisy (np.array): The noisy image. """ fig, axes = plt.subplots(1, 2, figsize=(10, 5)) axes[0].imshow(original) axes[0].set_title("Original Image") axes[0].axis("off") axes[1].imshow(noisy) axes[1].set_title("Image with Random Irregular Noise Patches") axes[1].axis("off") plt.tight_layout() plt.show() def main(file_path:Path, amount:float, salt_vs_pepper:float): # Load the image image = load_image(file_path) # Apply the noise noisy_image = apply_random_irregular_noise(image, amount, salt_vs_pepper) pil_image = Image.fromarray(noisy_image) # save noisy image output_file_path = Path('noisy_frames') / f"{file_path.stem}_noisy{file_path.suffix}" output_file_path.parent.mkdir(exist_ok=True) pil_image.save(output_file_path, format='JPEG') # Display the original and noisy images plot_images(image, noisy_image) if __name__ == "__main__": file_path = Path('frames') / 'frame_0.jpg' amount = 0.01 # Fraction of image pixels to be noised salt_vs_pepper = 0.6 # Fraction of noise that is salt (white) main(file_path, amount, salt_vs_pepper)
- 1
- 3
- 57
질문&답변
df 에서 바이너리 값 이미지로 안보이는 현상
안녕하세요, 열공 하시는 모습 너무 보기 좋습니다~^^ 일단, metadata 적용에는 문제가 없습니다. spark 3.3+ 이면 메타데이터를 통해 display() 를 통해 df 의 이미지를 출력하는 것은 정상적으로 이루어져야 합니다. 일단, 두 가지를 의심해 볼 수 있겠네요. 1. path.replace("dbfs:", "") 부분이 문제가 있어 보이네요. /dbfs 가 데이터브릭스 볼륨의 기본 단위일텐데, 이것을 삭제한 것이 문제가 되는 지 체크해 보세요. from PIL import Image 호출이 안되어 있는데, 이 부분도 체크 한 번 해 보시구요.이렇게 해서도 해결이 안된다면,pandas_udf 로 만들기 전에 샘플 경로 하나를 가지고 정상적으로 작동하는 지 확인 후에 최종적으로 사용하면 udf로 만들어 사용한다면 아마 오류를 잡아낼 수 있지 않을까 생각합니다. 그럼 열공하세요!
- 0
- 1
- 36
질문&답변
코드 자료 요청
네, 이메일 보냈습니다. 확인해 보세요.열공!
- 0
- 2
- 54
질문&답변
o3-mini 모델은 이미지를 지원안하나요
안녕하세요! o3-mini 는 비전 기능을 지원하지 않는 것으로 알고 있습니다. STEM 중심의 시나리오에 적합하는 모델이라고 생각하시면 될 것 같아요. 코드를 따라하면서 아마 다양한 모델을 테스트 해 보시는 것 같은데요, 가끔 이렇게 오류가 나면 당황스러울 수 있습니다. 그럴 땐, 모델이 지원하는 기능의 한계 등의 자료를 찾아보면 도움이 됩니다^^ 그럼 열공하세요~
- 0
- 1
- 34




