목록전체 글 (117)
quilt code
1.
(작성중) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 import sys from PyQt5.QtWidgets import * from PyQt5 import uic import selenium from selenium import webdriver from selenium.webdriver.common.by import By from day24.daocrawl import DaoCrawl #GUI 환경이용(GUI는 계속 대기하는 성질이 있음) form_class = uic.loadUiType("my_crawl3.ui")[0] class MyWindo..
작성중 BeautifulSoup : 텍스트 형태의 html 데이터를 추출하기 위한 도구 설치) pip install beautifulsoup4 1. my_bs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import requests from bs4 import BeautifulSoup url = 'http://localhost:8000/' response = requests.get(url) # #베낀 코드 # if response.status_code == 200: #응답코드 200 : 서버가 성공했을때 # html = response.text # soup = Beautif..
1. my_flask 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 from flask import Flask, request from flask.templating import render_template from day08.dao_book import DaoBook import json app = Flask(__name__) db = DaoBook() @app.route('/'..
OpenCV : Open Source Computer Vision Library (설치- cmd에서 pip install opencv-python) 이미지 읽어오기 cv2.imread(imgFile, flag) imgFile : 이미지 파일 경로 flag : 이미지 파일을 읽어올 때 옵션 1 : imread_color : color(BGR)로 읽기, default값=1(flag 생략) 0: imread_grayscale : 흑백 -1 : imread_unchanged : color + alpha channel까지 포함 이미지 출력 cv2.imshow('title', img) title : windows 창 이름 img : 이미지 파일 cv2.waitKey(time) 키 입력 대개 time : mesc 시..
가위바위보 예제 1. day15 1. gawi_mnist user가 무조건 이기는 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 import tensorflow as tf import numpy as np x_train = [ [1, 0, 0], #가위 [0, 1, 0], #바위 [0, 0, 1], #보 ] y_train = [2, 0, 1] x_test = [ [1, 0, 0] #가위 ] x_train_np = np.array(x_train, dtype='f') #모델의 입맛에 맞추기 위해 실수로 바꿈 / 배열은 모델안에 들어갈 수..
cifar10 : mnist와 같이 머신러닝 연구에 사용되는 dataset day17) 1. mycifar10_1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 import tensorflow as tf import numpy as np # 1. Fashion MNIST 데이터셋 임포트 fashion_mnist = tf.keras.datasets.fashion_mnist (train_images, train_labels), (test_images, test_labels) = fashion_mnist.load_data() # 2. 데이터 전처리 train_ima..
홀짝 예제 1. day13 1. holjjak_mnist ** user가 무조건 지는 (com이 이기는) 게임 ** 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 import tensorflow as tf import numpy as np x_train = [ [1,0], #홀 [0,1], #짝 ] # y_train = [0,1] #x_train [1,0]이면 y_train 0, x_train [0,1]이면 y_train 1 / x_train에 대한 정답 y_train = [1,0] # y_train이 [1,0]이면 무조건..