본문 바로가기

분류 전체보기502

[Django] login, join, 회윈 가입 login 📌 urls.py-member 실행 # -*- coding: utf-8 -*- """ Created on Wed Dec 21 10:19:40 2022 @author:KITCOOP member/urls.py """ from django.urls import path from . import views # 127.0.0.1:8000/member/login 요청시 views.py의 ligin 함수 실행 urlpatterns = [ path("login/", views.login, name="login"), ] 📌 views.py 실행 from django.shortcuts import render # Create your views here. # member/views.py # 127.0.0.1:8.. 2023. 4. 27.
[Django] 장고 템플릿 설명 * 템플릿 시스템 - 템플릿 변수 : {{variable}} 변수를 평가해서 변수값으로 출력 변수명은 일반 프로그래밍의 변수명처럼 문자, 숫자, 밑줄(_)을 사용하여 이름을 정의 {{name|lower}} naem 변수값의 모든 문자를 소문자로 바꿔주는 필터 {{text(escape)|linebreaks}} 필터를 체인으로 연결 가능 {{bio|truncatewords:30}} bio변수값 중에서 앞에 30개의 단어만 보여주고 줄바꿈 문자는 모두 삭제 - 템플릿 태그 {% for athlete in athlete_list %} {{ sthlete.name }} {% endfor %} 📌 {% extends "base1.html" %} {# 한줄 주석. base1.html 파일을 가져옴 #} {% bloc.. 2023. 4. 27.
[Python] 컬러 이미지 분석하기 📌 ######################################### # 컬러 이미지 분석하기 # 인터넷을 통해 이미지 조회하기 image_path = tf.keras.utils.get_file('cat.jsp', '') image_path image = plt.imread(image_path) # 고양이 이미지의 배열값 image.shape # (241, 320, 3) import cv2 cv2.imshow("cat", image) plt.imshow(image) brg = cv2.split(image) # 색상별로 분리 bgr = cv2.split(image) bgr[0].shape # 빨강 bgr[1].shape # 초록 bgr[2].shape # 파랑 plt.imshow(bgr[0]) c.. 2023. 4. 27.
[Python] 이항 분류 📌 ########################################## # 이항 분류 : 분류의 종류가 2종류인 경우 import pandas as pd url = "" red = pd.read_csv(url + 'winequality-red.csv', sep=';') # red와인 정보 white = pd.read_csv(url + 'winequality-white.csv', sep=';') #white와인 정보 red.info() white.info() ''' 1 - fixed acidity : 주석산농도 2 - volatile acidity : 아세트산농도 3 - citric acid : 구연산농도 4 - residual sugar : 잔류당분농도 5 - chlorides : 염화나트륨농도.. 2023. 4. 27.
[Python] 2023-01-02 복습 📌 ################################################## # Fashion-MNIST 데이터셋 다운로드 from tensorflow.keras.datasets.fashion_mnist import load_data from tensorflow.keras.utils import to_categorical from sklearn.model_selection import train_test_split from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten import numpy as np (x_train, y_train), (x_test, y_test) .. 2023. 4. 27.
[Python] Fashion-MNIST 데이터를 이용하여 예측 평가하기 📌 ################################################## # Fashion-MNIST 데이터셋 다운로드 from tensorflow.keras.datasets.fashion_mnist import load_data (x_train, y_train), (x_test, y_test) = load_data() print(x_train.shape,x_test.shape) #(60000, 28, 28) (10000, 28, 28) class_names=['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot'] y_train[:10] # [9, 0.. 2023. 4. 27.
[Python] MNIST 데이터를 이용하여 숫자를 학습하여 숫자 인식 📌 # MNIST 데이터를 이용하여 숫자를 학습하여 숫자 인식하기. # MNIST 데이터셋 다운받기 from tensorflow.keras.datasets.mnist import load_data (x_train, y_train),(x_test, y_test)=\\ load_data(path='mnist.npz') x_train.shape # (60000, 28, 28), 훈련데이터 y_train.shape # (60000,) x_test.shape # (10000, 28, 28), 테스트데이터 y_test.shape # (10000,) import matplotlib.pyplot as plt import numpy as np # 0~59999 사이의 임의의 수 3개 random_idx = np.rand.. 2023. 4. 27.
[Python] Tensortflow ''' Tensorflow 설치 1. 연결 2. 다운로드 센터 클릭() 3.개발자 도구 클릭 4. 05. Visual Studio 2015용 vISUAL c++ 재배포 가능 선택 5. 다운로드 클릭 6. vc_redist.x64.exe 선택 => 다음클릭 => 다운받기 7. 파일탐색기에서 vc_redict.x64.exe 실행 8. anaconda prompt를 관리자 모드로 실행 9. pip install tensorflow 치기 tensorflow 버전 확인 : 2.11.0 ''' 📌 import tensorflow as tf # .__version__ : 버전 확인 가능 print(tf.__version__) # 2.11.0 # 현재 컴퓨터가 GPU? tf.config.list_physical_dev.. 2023. 4. 27.