Python/Application5 [Python] Streamlit 활용 전 정리 참고 블로그 : https://blog.zarathu.com/posts/2023-02-01-streamlit/ 차라투 블로그 - Python Streamlit 패키지를 이용한 대시보드 만들기https://docs.streamlit.io/library/api-reference 를 바탕으로 정리한 글입니다. 2023년 2월 기준) streamlit version 1.17.0 을 기준으로 작성하였습니다. Streamlit 소개 언제 스트림릿을 사용해야할지 스트림릿이 타blog.zarathu.com 0. 제목 만들기 1. Tab 만들기import streamlit as st# 탭 생성 : 첫번째 탭의 이름은 Tab A 로, Tab B로 표시합니다. tab1, tab2= st.tabs(['Tab A' , 'Tab.. 2024. 6. 5. [Data Scraping] Error : Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same Error 내용 Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same -> data는 다음과 같이 use_cuda = torch.cuda.is_available() device = torch.device("cuda" if use_cuda else "cpu") image = np.array(cv2.imread('./sample_data/Black_porgy.JPG')) image = transform(image=image)['image'] image = image.unsqueeze(0) image = image.to(device, dtype=torch.float32) device 즉, cuda에 올.. 2023. 2. 10. [Data Scraping] 구글에서 고화질 이미지 스크래핑(크롤링) - selenium Selenium 에 관해 배웠던 것을 이용하여 구글에서 고화질 이미지를 스크래핑 해보고자 한다 Before Running Data_Scraping.py 1. 먼저 본인의 크롬 브라우저의 버전을 확인한다 크롬창 우측 상단 더보기 -> 도움말 -> Chrome 정보 본인 :버전 108.0.5359.126(공식 빌드) (64비트) 2. 본인의 버전에 맞는 chromeDriver를 설치 https://chromedriver.chromium.org/downloads 에 들어가서 자신에게 맞는 OS를 선택 (맨뒤의 126 등은 무시 가능) ex) 본인 :버전 108.0.5359.126 -> 버전 108.0.5359 3. 본인의 Chromedriver를 저장해주자 압축을 풀고 Sashimi안에 있는 chromedri.. 2023. 1. 27. [Scraping] Web Crowling 이라기 보단 Scraping (beautifulsoup4) 자 묻지도 따지지도 말고 라이브러리 부터 다운 받읍시다 pip install beautifulsoup4 pip install lxml 저 두번째 꺼는 엘 엑스 엠 엘 임ㅇㅇ... 자 네이버 웹툰의 url을 가져 옵시다 import requests from bs4 import BeautifulSoup url = "https://comic.naver.com/webtoon/weekday" res = requests.get(url) res.raise_for_status #못가져올시 프로그램 종료되게 soup = BeautifulSoup(res.text, "lxml") 마지막 줄은 우리가 url 로 가져온 res를 lxml을 통해서 BeatifulSoup 객체로 만듬 이러면 soup에 모든 정보를 가지고 있다 다.. 2023. 1. 24. [Scraping] HTML, XPath, Requests,정규식 찍먹해보기 (+User-agent) 다음 강의를 정리하여 작성하였습니다 https://www.youtube.com/watch?v=yQ20jZwDjTE&list=LL&index=3&t=1526s 웹 스크래핑 -> 웹 페이지에서 내가 원하는 정보를 가져 오는 것 웹 크롤링 -> 웹페이지에서 링크를 따라가며 모든 내용을 가져오는 것 HTML Hyper Text Markup Language 즉 웹페이지 만드는 언어이다 VSC에서 이걸 열고 싶으면 HTML은 아래와 같이 코드를 작성한다 보통 다음과 같이 이것을 기본 구조로 가진다 이를 응용해보면 Hello World 먼저 꺽쇠로 시작을 하고 /로 닫으므로써 element로 구성한다 바로닫고 싶으면 이렇게도 쓴다 head : 홈페이지의 제목, 선행작업 body : 웹페이지의 본문 h1 : 글자가 크.. 2023. 1. 19. 이전 1 다음