AI

    flask서버에서 yolov4 모델 실행하기

    import flask import werkzeug from flask import send_file from yolov4.detect import * import pandas as pd import tensorflow as tf from bs4 import BeautifulSoup import requests app = flask.Flask(__name__) @app.route('/', methods = ['GET', 'POST']) def handle_request(): # Recive Img imagefile = flask.request.files['image'] filename = werkzeug.utils.secure_filename(imagefile.filename) imagefile.save..

    BP 알고리즘 without tensorflow

    ''' 입력층 2 히든층 4 출력층 2 ''' import numpy as np import random # def get_Weight(len): # W_hidden = [] # for i in range(len): # tmp = [] # for j in range(len): # tmp.append(0) # W_hidden.append(tmp) # W_hidden = np.array(W_hidden) # Out_hidden = tmp # return W_hidden, Out_hidden def sigmoid(x): return 1 / (1 + np.exp(-x)) def softmax(x): # 소프트맥스한 값들의 모두 합친 값은 1 # 가장 큰 클래스가 가장 높은 확률로 사용될 것 for i in ra..

    yolov3 커스텀 학습

    yolov3 커스텀 학습

    공부한 것을 다시 정리하기 위해서 작성했습니다 참고해주세요 참고 주소 - #011 TF YOLO V3 Object Detection in TensorFlow 2.0 (datahacker.rs) 1. 무료 GPU사용을 위한 Colab 설정하기 colab.research.google.com/ Google Colaboratory colab.research.google.com 새 노트만든 뒤 런타임 -> 런타임유형 변경 후 GPU 설정 2. Train하기 위한 준비 !git clone https://github.com/AlexeyAB/darknet.git %cd darknet !ls !sed -i 's/OPENCV=0/OPENCV=1/' Makefile !sed -i 's/GPU=0/GPU=1/' Makefil..

    BP알고리즘 사용하기 with tensorflow

    1. x_train, y_train 설정 x_train = ㄱ ~ ㅊ까지 5x5 배열로 표현 y_train = 0 ~ 9까지 순서대로 ㄱ - 0, ㄴ - 1, ㄷ- 2, ㄹ-3, ㅁ-4, ㅂ-5, ㅅ-6, ㅇ-7, ㅈ-8, ㅊ-9 # -*- coding: utf-8 -*- import tensorflow as tf from tensorflow import keras import numpy as np # ㄱ Giyeok_train = [[1,1,1,1,1], [0,0,0,0,1], [0,0,0,0,1], [0,0,0,0,1], [0,0,0,0,1]] # ㄴ NeeEun_train = [[1,0,0,0,0], [1,0,0,0,0], [1,0,0,0,0], [1,0,0,0,0], [1,1,1,1,1]] #ㄷ ..