Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 186 commits into
base: feedback
Choose a base branch
from
Open
Changes from 11 commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
6ca39f2
Setting up GitHub Classroom Feedback
github-classroom[bot] Feb 1, 2024
fc1bdce
init FastAPI
ChoHyoungSeo Feb 27, 2024
98c8b5a
Update app.py
ChoHyoungSeo Feb 27, 2024
82304b1
Update index02.html
ChoHyoungSeo Feb 27, 2024
4c9483d
Update main.html
ChoHyoungSeo Feb 27, 2024
522680f
poetry init
bkkhyunn Feb 29, 2024
1ccb40f
init poetry
bkkhyunn Feb 29, 2024
d853682
git init
bkkhyunn Feb 29, 2024
af22bc8
git init
bkkhyunn Feb 29, 2024
a864e7a
docs : update poetry dependencies
bkkhyunn Feb 29, 2024
1c2e9b9
init git
bkkhyunn Feb 29, 2024
e4c3bd7
docs : Add server setting script
bkkhyunn Feb 29, 2024
e4961e0
docs : update server_setting.sh
bkkhyunn Feb 29, 2024
f957544
feat : web-server v0.2
bkkhyunn Mar 1, 2024
c6eda25
feat : web-server v0.3
bkkhyunn Mar 1, 2024
96d2fdb
feat: change form tag (action, method)
ParkJeongmiin Mar 3, 2024
b9441e2
feat: add signup post method
ParkJeongmiin Mar 3, 2024
cb1393c
feat: change user_create func
ParkJeongmiin Mar 3, 2024
9abf0ee
fix: change router name
ParkJeongmiin Mar 3, 2024
66fe92f
feat: add login_router
ParkJeongmiin Mar 3, 2024
1821978
feat: add login, token logic
ParkJeongmiin Mar 3, 2024
0a121f0
feat: add form tag
ParkJeongmiin Mar 3, 2024
436fb10
fix: change submit button method
ParkJeongmiin Mar 3, 2024
7c2a9aa
Merge pull request #4 from boostcampaitech6/feat/3
ParkJeongmiin Mar 3, 2024
cd548e0
refact: change nav bar
ParkJeongmiin Mar 3, 2024
e74c330
feat: add form tag
ParkJeongmiin Mar 3, 2024
8abb180
feat: change logout href
ParkJeongmiin Mar 4, 2024
31eca4b
feat: add logout method
ParkJeongmiin Mar 4, 2024
83d781c
Merge pull request #7 from boostcampaitech6/feat/6
ParkJeongmiin Mar 4, 2024
a75f7d8
feat: add homepage
sujin-1013 Mar 5, 2024
d5a09ad
fix: change login, singup logout logic
cogito21g Mar 5, 2024
def2bce
sujin-1013 Mar 5, 2024
28bd191
Merge branch 'web-dev' of https://github.com/boostcampaitech6/level2-…
sujin-1013 Mar 5, 2024
86904a6
fix: change homepage
sujin-1013 Mar 5, 2024
7782152
[FEAT] 유저 별 업로드 된 영상을 나열하는 기능 (#9)
ParkJeongmiin Mar 5, 2024
ee1b382
fix: change logout url (#11)
ParkJeongmiin Mar 5, 2024
424db08
feat : web-server v0.5
bkkhyunn Mar 6, 2024
f4f7902
refact: change check token process
ParkJeongmiin Mar 6, 2024
0c87f85
refact: change check token process
ParkJeongmiin Mar 6, 2024
93abb5f
refact: change check token process
ParkJeongmiin Mar 6, 2024
804a66f
refact: change check token process
ParkJeongmiin Mar 6, 2024
32532ac
refact: change check token process
ParkJeongmiin Mar 6, 2024
5ef538c
refact: change check token process
ParkJeongmiin Mar 6, 2024
6907457
[feat] feature csv 파일 저장 코드 추가
paokimsiwoong Mar 7, 2024
dcda66a
[fix] 잔코드 수정
paokimsiwoong Mar 7, 2024
87d07b9
[feat] videoMAEv2 feature extraction 추가
paokimsiwoong Mar 7, 2024
10e20e3
[fix] 잔 코드 수정
paokimsiwoong Mar 7, 2024
a008505
[fix] 잔코드 수정 2
paokimsiwoong Mar 7, 2024
fa9f472
feat : web-server v0.7
bkkhyunn Mar 8, 2024
dcd9316
feat : Update html, css design
bkkhyunn Mar 8, 2024
ac52215
fix: merge web-dev-bk
cogito21g Mar 8, 2024
7c1acb3
fix: modify signin/login/logout logic
cogito21g Mar 8, 2024
27fa074
[feat] LSTM 학습 코드 추가 + 잔 코드 수정
paokimsiwoong Mar 8, 2024
01a0821
[feat] pth 추가
paokimsiwoong Mar 8, 2024
b44d018
fix: bugfix logout/modify token logic
cogito21g Mar 8, 2024
a19082c
fix:
cogito21g Mar 8, 2024
029313b
fix: project structure
cogito21g Mar 8, 2024
64950fb
feat : Update web design
bkkhyunn Mar 8, 2024
529e74b
feat : Add auto reload
bkkhyunn Mar 8, 2024
9e51411
feat: video info data to modal
ParkJeongmiin Mar 10, 2024
fdd772b
feat: add rename file name process
ParkJeongmiin Mar 10, 2024
2930a6e
fix: delete unnecessary part
ParkJeongmiin Mar 10, 2024
d083478
feat: set relationship (upload, complete)
ParkJeongmiin Mar 11, 2024
7b63b43
feat: video info data to modal
ParkJeongmiin Mar 11, 2024
90afe86
feat: add delete data process
ParkJeongmiin Mar 11, 2024
5961a88
[feat] file name csv 첫번째 항목으로 추가
paokimsiwoong Mar 11, 2024
fdcf66d
fix: add cascade between video, frame
ParkJeongmiin Mar 11, 2024
8f12b6e
[feat] feature_extraction 코드 수정 + abnormal dataset 추가
paokimsiwoong Mar 11, 2024
d83d111
[feat] feature extraction python file
sujin-1013 Mar 11, 2024
c7bc1c2
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
sujin-1013 Mar 11, 2024
2fd8e3a
[fix] 파일 경로 수정
paokimsiwoong Mar 11, 2024
acf00ee
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
paokimsiwoong Mar 11, 2024
d1c67a2
[feat] 검증 loop 정상+이상 정확도 추가
paokimsiwoong Mar 11, 2024
5590c1c
[fix] 잔코드 수정
paokimsiwoong Mar 11, 2024
05b638c
[feat] auc 스코어 계산 추가
paokimsiwoong Mar 11, 2024
cedcefd
[fix] 잔코드 수정
paokimsiwoong Mar 11, 2024
3042537
[fix] TODO 추가
paokimsiwoong Mar 11, 2024
cc16c02
[fix] auc score 코드 수정
paokimsiwoong Mar 12, 2024
616e917
[feat] VideoMAEv2용 dataset, classifier 추가
paokimsiwoong Mar 12, 2024
664d800
[feat] MIL loss 추가
paokimsiwoong Mar 13, 2024
1adda3d
feat : web-server v0.8
bkkhyunn Mar 13, 2024
10ba294
[feat] MIL 모델 학습 코드 추가
paokimsiwoong Mar 13, 2024
6cae2e5
[fix] 잔코드 수정
paokimsiwoong Mar 13, 2024
7c2c788
feat : web-server v0.85
bkkhyunn Mar 13, 2024
4ae6410
fix: refactoring project
cogito21g Mar 13, 2024
66df137
fix: merge branch web-dev-kh
cogito21g Mar 13, 2024
a0875ec
fix: modifying... album
cogito21g Mar 13, 2024
cd0779d
[feat] 데이터셋 로드 방식 변경
paokimsiwoong Mar 14, 2024
1cb1309
[fix] 스케쥴러 get_lr을 get_last_lr로 변경
paokimsiwoong Mar 14, 2024
7ec130f
[fix] gt 라벨링 방식 변경 mean => max
paokimsiwoong Mar 14, 2024
38840d3
feat: update code
bkkhyunn Mar 14, 2024
1fd4e1d
fix: modify stream
cogito21g Mar 14, 2024
b5d8adc
[fix] 잔코드 수정
paokimsiwoong Mar 14, 2024
87c46cc
[fix] feature length 변경해도 코드 수정 필요 없도록 수정
paokimsiwoong Mar 14, 2024
f959f67
[fix] 정확도 확률 계산 오류 수정
paokimsiwoong Mar 14, 2024
b6852c6
[fix] auc 계산식 수정
paokimsiwoong Mar 14, 2024
22f0cb4
[feat] 복수 폴더 csv 생성
paokimsiwoong Mar 14, 2024
e77ed9e
feat : web-server v0.9
bkkhyunn Mar 14, 2024
45813e3
[fix] gitignore 수정
paokimsiwoong Mar 15, 2024
eabef26
temp
cogito21g Mar 15, 2024
36af4d3
merge web-dev-kh
cogito21g Mar 15, 2024
645cf16
[feat] 영상 예측 score 평균, 최대값 표시 추가
paokimsiwoong Mar 15, 2024
0e7fe1e
[fix] 잔 코드 수정
paokimsiwoong Mar 15, 2024
a620421
[fix] 수치 일부 조정
paokimsiwoong Mar 15, 2024
fabc88f
feat: add alarm feat
ParkJeongmiin Mar 15, 2024
c2a0474
fix: change mail content
ParkJeongmiin Mar 15, 2024
9597cdd
fix: change websocket server address
ParkJeongmiin Mar 15, 2024
5c33a24
[fix] 수치 조정
paokimsiwoong Mar 15, 2024
01a738a
[fix] max -> mean
paokimsiwoong Mar 15, 2024
737de4c
[feat] fpr, tpr, best thr 추가
paokimsiwoong Mar 16, 2024
b3ec66a
fix: change alarm service method
ParkJeongmiin Mar 17, 2024
c220841
fix: change mail detail
ParkJeongmiin Mar 17, 2024
a3a1181
fix: increase updateUI interval
ParkJeongmiin Mar 17, 2024
8b60aad
temp
cogito21g Mar 17, 2024
a3ef2df
temp2
cogito21g Mar 17, 2024
1bf7dcb
[fix] 잔 코드 수정
paokimsiwoong Mar 18, 2024
9434803
fix : upload video anomaly detection cv2 오류 예외처리
bkkhyunn Mar 18, 2024
09fbd82
temp
cogito21g Mar 18, 2024
61e53af
fix: merge web-dev-kh
cogito21g Mar 18, 2024
02721e4
fix: modify html files
cogito21g Mar 18, 2024
84bd393
fix: modify templates
cogito21g Mar 18, 2024
250910a
Squashed commit of the following:
paokimsiwoong Mar 18, 2024
6922e6e
[feat] web vmae+mil 연결
paokimsiwoong Mar 19, 2024
c05cd1d
[fix] ModuleNotFoundError 해결
paokimsiwoong Mar 19, 2024
2c6146a
feat : fix model inference code
bkkhyunn Mar 19, 2024
2f32d1c
[fix] 이상 탐지 코드 수정
paokimsiwoong Mar 19, 2024
31c4c62
temp
cogito21g Mar 19, 2024
31dc885
[fix] feature 추출 py 파일 수정
paokimsiwoong Mar 20, 2024
d2fe35a
중복제거중
cogito21g Mar 21, 2024
f6557e9
feat : LSTM-AE 구현
bkkhyunn Mar 22, 2024
b7cb05e
reset
cogito21g Mar 24, 2024
ceb4ebe
fix: check upload
cogito21g Mar 24, 2024
3b5f284
fix: check album_page and real_time_page
cogito21g Mar 24, 2024
7282fed
check
cogito21g Mar 24, 2024
0244514
docs: add README.md
cogito21g Mar 24, 2024
034a184
modify README.md
cogito21g Mar 24, 2024
5e8a597
[feat] BN-WVAD 모델 추가
paokimsiwoong Mar 25, 2024
fcaf4a0
fix: modify albume_list/album_detail
cogito21g Mar 25, 2024
d8340b6
fix: modify video \r\n - seperate script
cogito21g Mar 25, 2024
3784262
[fix] BN-WVAD scatter 코드 수정
paokimsiwoong Mar 25, 2024
ad874df
[feat] ap추가, val metric 변경
paokimsiwoong Mar 25, 2024
46415d8
[fix] 로컬 gitignore
paokimsiwoong Mar 25, 2024
8241662
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
paokimsiwoong Mar 25, 2024
e816fdf
[fix] 잔코드수정
paokimsiwoong Mar 25, 2024
d571b69
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
paokimsiwoong Mar 25, 2024
0aa3b8f
Squashed commit of the following:
paokimsiwoong Mar 25, 2024
4f78eca
[fix] track 선 삭제
paokimsiwoong Mar 25, 2024
26f1f38
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
paokimsiwoong Mar 25, 2024
f424855
[fix] 잔 코드 수정
paokimsiwoong Mar 25, 2024
cb70249
[fix] mil 잔코드 수정
paokimsiwoong Mar 25, 2024
870c90a
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
paokimsiwoong Mar 25, 2024
5f13c6e
feat : Add LSTM-AE
bkkhyunn Mar 25, 2024
90413c3
temp
bkkhyunn Mar 26, 2024
b6780cd
temp
bkkhyunn Mar 26, 2024
f808978
Merge remote-tracking branch 'origin/model-sw' into dev
bkkhyunn Mar 26, 2024
92ed5e1
feat : Dev branch
bkkhyunn Mar 26, 2024
40fcac4
feat : Modify dir
bkkhyunn Mar 26, 2024
af67d96
fix code
bkkhyunn Mar 26, 2024
1b3a4e5
feat : Merge web dev
bkkhyunn Mar 26, 2024
1be391a
fix : modify code
bkkhyunn Mar 26, 2024
386d468
fix : modify code
bkkhyunn Mar 26, 2024
ff35310
docs : Update README.md
bkkhyunn Mar 26, 2024
1d38474
fix : modify html
bkkhyunn Mar 26, 2024
272559b
feat : 분석 중 기능 추가 / 스크린샷 수정
bkkhyunn Mar 26, 2024
fff3b66
feat : Update LSTM-AE, VMAE & youtube streaming
bkkhyunn Mar 26, 2024
f328a0a
docs : requirements.txt
bkkhyunn Mar 26, 2024
e172e1e
feat : Server scale out
bkkhyunn Mar 26, 2024
1a96f38
fix : 잔 오류 수정
bkkhyunn Mar 27, 2024
fb6f386
[feat] UCF crime 데이터셋 코드 추가 및 코드 변경 정리
paokimsiwoong Mar 28, 2024
93794e6
Merge branch 'model-sw' of https://github.com/boostcampaitech6/level2…
paokimsiwoong Mar 28, 2024
34e2ce7
[feat] UCF Crime 데이터셋 BN-WVAD 학습 코드
paokimsiwoong Mar 29, 2024
b6d66ea
[feat] UCF Crime MIL 학습 코드 추가
paokimsiwoong Mar 29, 2024
97ea2f0
[fix] ab_acc 코드 수정
paokimsiwoong Mar 29, 2024
fc6037c
[feat] feature l2 normalization 추가
paokimsiwoong Mar 29, 2024
0465fa4
feat: update code
bkkhyunn Apr 1, 2024
56af3da
Merge branch 'dev-scaleout' into dev
bkkhyunn Apr 1, 2024
3d3d9df
merge: model into dev
bkkhyunn Apr 1, 2024
101a603
Merge pull request #15 from boostcampaitech6/dev
bkkhyunn Apr 1, 2024
2cfb11e
docs: README 작성
bkkhyunn Apr 1, 2024
41cecf0
docs: update README
bkkhyunn Apr 1, 2024
fdc42da
docs: update README
bkkhyunn Apr 1, 2024
c66d948
docs: update REAMDE
bkkhyunn Apr 1, 2024
cde439a
docs: update README
bkkhyunn Apr 1, 2024
419c868
docs: update README
bkkhyunn Apr 1, 2024
7bb3efd
feat: .env guide
bkkhyunn Apr 1, 2024
0ed8f3c
feat: linting code
bkkhyunn Apr 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ datapreprocess/*.csv
datapreprocess/*.pt
datapreprocess/*.pth
datapreprocess/npy
datapreprocess/nohup.out
model_train/code_prac.ipynb
model_train/model.h5
model_train/pytorch_model.pth
@@ -35,6 +36,8 @@ model_train/*.ipynb
model_train/wandb
app/testitems/
pths/
app/models/pts
app/models/yolov8n-pose.pt
.netrc

### macOS ###
@@ -296,4 +299,6 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,jupyternotebooks,virtualenv,python
# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,macos,windows,jupyternotebooks,virtualenv,python

dataset/
157 changes: 117 additions & 40 deletions app/api/album_router.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
from datetime import timedelta, datetime, date
from typing import Optional
import ast

from fastapi import APIRouter, Response, Request, HTTPException, Form, UploadFile, File, Cookie, Query
from fastapi import APIRouter, Response, Request, HTTPException, Form, UploadFile, File, Cookie, Query, Depends
from fastapi.responses import RedirectResponse
from fastapi.templating import Jinja2Templates
from fastapi import Depends
from fastapi.security import OAuth2PasswordRequestForm, OAuth2PasswordBearer
from jose import jwt, JWTError
from sqlalchemy.orm import Session
from starlette import status

from core.config import get_settings
from db.database import get_db, db_engine
from models import models
from crud import crud
from crud.crud import pwd_context
from schemas import schemas

from utils.config import settings, get_db, db_engine

from database import crud, models
from database.crud import pwd_context

from api.user_router import get_current_user
import boto3
from botocore.config import Config

settings = get_settings()

templates = Jinja2Templates(directory="templates")

router = APIRouter(
prefix="/album",
)
@@ -42,18 +36,42 @@
@router.get("")
async def upload_get(request: Request,
db: Session = Depends(get_db)):
token = request.cookies.get("access_token", None)
if token:
token = ast.literal_eval(token)
else:
user = get_current_user(request)
if not user:
return RedirectResponse(url='/user/login')

email = token['email']

user = crud.get_user_by_email(db=db, email=email)

album_list = crud.get_uploads(db=db, user_id=user.user_id)

return templates.TemplateResponse("album.html", {'request': request, 'token': token, 'album_list':album_list})
return templates.TemplateResponse("album_list.html", {'request': request, 'token': user.email, 'album_list':album_list})


@router.post("")
async def modify_name(request: Request,
check_code: str = Form(...),
upload_id: Optional[int] = Form(...),
origin_name: Optional[str] = Form(None),
new_name: Optional[str] = Form(None),
is_real_time: Optional[bool] = Form(None),
db: Session = Depends(get_db)):
user = get_current_user(request)

if check_code == "edit":
upload_info = db.query(models.Upload).filter((models.Upload.name == origin_name) &
(models.Upload.upload_id == upload_id)).first()
upload_info.name = new_name

db.add(upload_info)
db.commit()
db.refresh(upload_info)
elif check_code == "delete":
upload_info = crud.get_upload(db, upload_id)
if upload_info:
db.delete(upload_info)

db.commit()
album_list = crud.get_uploads(db=db, user_id=user.user_id)

return templates.TemplateResponse("album_list.html", {'request': request, 'token': user.email, 'album_list': album_list})


@router.get("/details")
@@ -62,30 +80,89 @@ async def upload_get_one(request: Request,
upload_id: int = Query(...),
db: Session = Depends(get_db)
):

token = request.cookies.get("access_token", None)
if token:
token = ast.literal_eval(token)


user = get_current_user(request)

video_info = {
"user_id": user_id,
"upload_id":upload_id,
"date": None,
"upload_name": None,
"is_realtime": None,
"video_id": None,
"video_url": None,
"frame_urls": None,
"score_url": None,
"complete": None
}


video = crud.get_video(db=db, upload_id=upload_id)
video_info["video_id"] = video.video_id
uploaded = crud.get_upload(db=db, upload_id=video.upload_id)
frames = crud.get_frames(db=db, video_id=video.video_id)
#obj = f"https://{settings.BUCKET}.s3.ap-northeast-2.amazonaws.com/{video_url}"
obj = s3.generate_presigned_url('get_object',
video_info["upload_name"] = uploaded.name
video_info["is_realtime"] = uploaded.is_realtime
video_info["date"] = uploaded.date.strftime('%Y-%m-%d %H:%M:%S')

#frames = crud.get_frames(db=db, video_id=video.video_id)
frames = crud.get_frames_with_highest_score(db=db, video_id=video.video_id)
frame_ids = [frame.frame_id for frame in frames]
frame_urls = [frame.frame_url for frame in frames]
frame_timestamps = [frame.time_stamp for frame in frames]
frame_objs = []

video_obj = s3.generate_presigned_url('get_object',
Params={'Bucket': settings.BUCKET,
'Key': video.video_url},
ExpiresIn=3600)
obj_frame = s3.generate_presigned_url('get_object',


video_info["video_url"] = video_obj
video_info["complete"] = crud.get_complete(db=db, upload_id=upload_id).completed
if not video_info["complete"]:
return templates.TemplateResponse("album_detail.html", {'request': request, 'token': user.email, 'video_info': video_info, 'loading': True})

if frame_ids != []:
for frame_id, frame_url, frame_timestamp in zip(frame_ids, frame_urls, frame_timestamps):
frame_obj = s3.generate_presigned_url('get_object',
Params={'Bucket': settings.BUCKET,
'Key': frame_url},
ExpiresIn=3600)
frame_objs.append((frame_id, frame_obj, frame_timestamp.strftime('%H:%M:%S')))

score_graph_url = '/'.join(frame_urls[0].split('/')[:-1]) + '/score_graph.png'
score_obj = s3.generate_presigned_url('get_object',
Params={'Bucket': settings.BUCKET,
'Key': score_graph_url},
ExpiresIn=3600)

video_info["frame_urls"] = frame_objs
video_info["score_url"] = score_obj


return templates.TemplateResponse("album_detail.html", {'request': request, 'token': user.email, 'video_info': video_info, 'loading': False})


@router.get("/details/images")
async def image_get(request: Request,
frame_id: int = Query(...),
db: Session = Depends(get_db)
):

user = get_current_user(request)
frame = crud.get_frame(db=db, frame_id=frame_id)
frame_obj = s3.generate_presigned_url('get_object',
Params={'Bucket': settings.BUCKET,
'Key': '/'.join(video.video_url.split('/')[:-1])},
'Key': frame.frame_url},
ExpiresIn=3600)
print(obj)
video_info = {
"user_id": user_id,
"upload_id": upload_id,
"date": uploaded.date,
"upload_name": uploaded.name,
"video_url": obj,
"frames": frames
print(frame_obj)
print(frame.box_kp_json)
frame_info = {
'frame_url': frame_obj,
'time_stamp': frame.time_stamp,
'frame_json': frame.box_kp_json
}

return templates.TemplateResponse("video.html", {'request': request, 'token': token, 'video_info': video_info})
return templates.TemplateResponse("frame.html", {'request': request, 'token': user.email, 'frame_info': frame_info})

Loading