본문 바로가기

전체 글

(104)
The process of half guard becoming coyote guard import networkx as nximport matplotlib.pyplot as plt# Graph 생성G = nx.DiGraph()# 노드 추가 (단계별)G.add_node("Half Guard")G.add_node("Underhook")G.add_node("Head Positioning")G.add_node("Coyote Guard Entry")G.add_node("Coyote Guard Established")# 간선 추가 (단계별 연결)G.add_edges_from([    ("Half Guard", "Underhook"),    ("Underhook", "Head Positioning"),    ("Head Positioning", "Coyote Guard Entry"),    ("Coy..
python web app puzzle game ( crop image, flask, pillow ) [directory] puzzle_game/│├── app.py                          # 메인 파이썬 애플리케이션 파일├── static/                         # 정적 파일을 저장하는 디렉토리│   ├── uploads/                    # 업로드된 이미지를 저장하는 디렉토리│   └── puzzle/                     # 퍼즐 조각 이미지를 저장하는 디렉토리│└── templates/                      # HTML 템플릿 파일을 저장하는 디렉토리    ├── upload.html                 # 이미지 업로드 폼 페이지    └── puzzle.html                 # ..
python webapp test meidiapipe csv flask pillow opencv [directory]face_recognition_app/ │ ├── app.py ├── known_faces/ │   ├── jiwon_han.jpg │   └── jaewook_song.jpg ├── static/ │   └── styles.css ├── templates/ │   ├── index.html │   └── result.html └── requirements.txt [app.py]from flask import Flask, request, render_template, redirectimport cv2import mediapipe as mpimport numpy as npimport osimport csvfrom datetime import datetimeapp = Flask(__nam..
파이썬 웹앱 버튼, 이미지 그리기 (python flask web-app create button, image draw) [directory]flask_image_app/│├── app.py├── requirements.txt└── templates/    └── index.html [requirement.txt]Flask==2.3.2Pillow==9.4.0  [app.py]from flask import Flask, render_template, jsonifyimport ioimport base64from PIL import Image, ImageDrawapp = Flask(__name__)def generate_image():    # 새로운 이미지 생성    img = Image.new('RGB', (200, 200), color=(73, 109, 137))    d = ImageDraw.Draw(img)    # 노..
과적합 테스트 (overfitting test) import numpy as npimport matplotlib.pyplot as pltfrom sklearn import datasets #pip install scikit-learniris_data = datasets.load_iris()input_data = iris_data.datacorrect = iris_data.targetn_data = len(correct)ave_input = np.average(input_data, axis=0)std_input = np.std(input_data, axis=0)input_data = (input_data - ave_input) / std_inputcorrect_data = np.average(input_data, axis=0)std_input = np...
[딥러닝] 주짓수 훈련과 복음 활동이 지능적 성장과 심리적 안정에 미치는 영향 분석 import numpy as npimport matplotlib.pyplot as pltfrom sklearn.model_selection import train_test_split #pip install scikit-learnfrom sklearn.linear_model import LinearRegressionimport tkinter as tkfrom tkinter import ttk #pip install ttkthemes# 데이터 생성 (예시 데이터)np.random.seed(0)n_samples = 100# 주짓수 훈련 시간, 복음 활동 시간, 심리적 안정 및 지능적 성장 점수 생성jujitsu_hours = np.random.normal(5, 2, n_samples)gospel_hours =..
딥러닝 다층화 - 국소 최적해 함정 영상 인식 분야에서 국소최적해 함정을 이해하기 위해, 다음과 같은 예시를 들어 설명할 수 있습니다: 1. **문제 설정**: 영상 인식에서는 이미지의 특정 객체를 찾거나 인식하기 위해 최적화 알고리즘을 사용할 수 있습니다. 예를 들어, 이미지 내에서 사람의 얼굴을 인식하려고 한다고 가정해 보겠습니다. 2. **손실 함수와 그래디언트**: 인식 모델은 보통 손실 함수(loss function)를 최소화하는 방향으로 학습합니다. 손실 함수는 모델의 예측과 실제 정답 간의 차이를 나타내며, 이 값을 최소화하는 것이 목표입니다. 학습 과정에서 그래디언트(기울기)를 계산하여 손실 함수의 값을 줄여나갑니다. 3. **국소최적해**: 만약 손실 함수가 복잡하고 다수의 지역적인 최적점(local optima)을 가진다..
역전파-분류(Backpropagation-classification) import numpy as npimport matplotlib.pyplot as pltX = np.arange(-1.0, 1.1, 0.1)Y = np.arange(-1.0, 1.1, 0.1)input_data = []correct_data = []for x in X:    for y in Y:        input_data.append([x, y])        if y np.sin(np.pi * x):            correct_data.append([0, 1])        else:            correct_data.append([1, 0])            n_data = len(correct_data)input_data = np.array(input_data)#np.ar..