diff --git a/README.md b/README.md index dd2f1d7cde08a1095ddbc6395e0276d1c7f60d6e..09888438640bf2cdec3caa84453b97f8237bb18e 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,3 @@ # foss-2024-2-final - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://git.ajou.ac.kr/y5ryan/foss-2024-2-final.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://git.ajou.ac.kr/y5ryan/foss-2024-2-final/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README - -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +## MMDetection 번역 이유 \ No newline at end of file diff --git "a/\353\262\210\354\227\255\355\216\230\354\235\264\354\247\200.md" "b/\353\262\210\354\227\255\355\216\230\354\235\264\354\247\200.md" index 596f0b6ad817c8f37c6b0f98d68ff64229b4ee23..376ee34a0aacac334d7947955fd7c11a5deb58c9 100644 --- "a/\353\262\210\354\227\255\355\216\230\354\235\264\354\247\200.md" +++ "b/\353\262\210\354\227\255\355\216\230\354\235\264\354\247\200.md" @@ -210,7 +210,7 @@ model = dict( ) ``` -## 데이터셋(Dataset) 및 평가에 대한 설정 +## 데이터셋(Dataset) 및 평가에 대한 설정(config) Runner는 MMDetection 프레임워크에서 모델을 훈련(train), 검증(validation), 테스트(test)를 하기 위한 기본적이고 필수적인 모듈이다. 이런 Runner를 사용하기 위해서는 데이터로더(DataLoader)가 필요하다. 데이터로더를 구축하려면 데이터셋과 데이터 파이프라인(이미지 크기 재설정 등과 같은 데이터 전처리 과정)을 설정해야 하며 이 부분의 복잡성을 줄이기 위해 데이터로더의 다양한 변수들이 사용된다. @@ -328,3 +328,92 @@ test_evaluator = dict( ) ``` +## 훈련 및 테스트 설정(config) +이전 단계에서 설명한 MMEngine의 Runner는 Loop를 사용하여 훈련(train), 검증(validation) 및 테스트(test) 과정을 제어한다. 사용자는 Loop를 이용해 최대 에폭과 검증 시간 간격 등 사용자의 입맛에 맞게 설정할 수 있다. + +``` +train_cfg = dict( + type='EpochBasedTrainLoop', # 훈련 Loop 종류. 자세한 내용은 https://github.com/open-mmlab/mmengine/blob/main/mmengine/runner/loops.py 참고 + max_epochs=12, # 최대 훈련(trainig) 에폭 + val_interval=1) # 검증(validation) 시간 간격. 매 에폭마다 검증을 실행함. +val_cfg = dict(type='ValLoop') # 검증 Loop 종류 +test_cfg = dict(type='TestLoop') # 테스트 Loop 유형 +``` + +## 최적화(optimization) 설정(config) + +`optim_wrapper`는 최적화 관련 설정을 구성하며 최적화와 관련된 다양한 기능(미분값 한계 설정, 혼합 정밀도 훈련 등)들을 제공한다. 더 자세한 내용은 최적화 문서에서 확인할 수 있다. + +``` +optim_wrapper = dict( # 최적화 기능 설정 + type='OptimWrapper', # 최적화 기능의 유형, 혼합 정밀도 훈련을 활성화하려면 AmpOptimWrapper로 변경 + optimizer=dict( # 최적화 설정. PyTorch에서 모든 종류의 최적화 함수들을 지원. 자세한 내용은 https://pytorch.org/docs/stable/optim.html#algorithms 참고 + type='SGD', # 확률적 경사 하강법 + lr=0.02, # 기본 학습률 + momentum=0.9, # 가속을 사용한 확률적 경사 하강법 + weight_decay=0.0001 # 확률적 경사 하강법의 가중치 감쇠 정도 + ), + clip_grad=None, # clip_grad를 None으로 설정하면 미분값 한계 설정(gradient clipping) 비활성화. 사용법은 https://mmengine.readthedocs.io/en/latest/tutorials/optimizer.html에서 확인 +) +``` + +`param_scheduler`는 학습률(learning rate), 가속(momentum) 등과 같은 최적화와 관련된 하이퍼파라미터를 조정하는 방법론들로 구성할 수 있다. 즉, 사용자는 여러 개의 스케줄러를 결합하여 본인이 원하는 파라미터 조정 전략을 만들 수 있다. 자세한 내용은 파라미터 스케줄러 튜토리얼과 파라미터 스케줄러 API 문서에서 확인할 수 있다. + +``` +param_scheduler = [ + # 초기 선형 학습률 스케줄러 + dict( + type='LinearLR', # 선형 방법론을 사용하여 초기 학습률 조정 + start_factor=0.001, # 초기에 사용되는 시작 학습률 비율 + by_epoch=False, # False이면 초기 학습률은 매 에폭이 아닌 매 반복마다 업데이트됨 + begin=0, # 첫 번째 반복부터 시작 + end=500 # 500번째 반복에서 초기 학습률 조정 종료 + ), + # 주요 선형 학습률 스케줄러 + dict( + type='MultiStepLR', # 훈련 중 다단계 학습률 방법론 사용 + by_epoch=True, # True이면 초기 학습률은 매 반복이 아닌 매 에폭마다 업데이트됨 + begin=0, # 첫 번째 에폭부터 시작 + end=12, # 12번째 에폭에서 종료 + milestones=[8, 11], # 학습률을 감소시킬 에폭 + gamma=0.1 # 학습률 감소 비율 + ) +] +``` + +## 훅(Hook) 설정(config) +사용자는 훈련(train), 검증(validation), 테스트(test) 루프(Loop)에 훅(Hook)을 추가하여 각 과정에서의 코드 실행 중에 사용자가 원하는 작업을 삽입할 수 있다. 훅에는 기본 훅(`default_hooks`)과 사용자 맞춤 훅(`custom_hooks`) 두 가지가 있다. + +`default_hooks`는 코드 실행 중 반드시 필요한 훅이다. 이는 수정해서는 안 되는 기본 우선순위를 가지고 있으며 설정하지 않으면 Runner가 기본값을 사용한다. 기본 훅을 비활성화하려면 사용자는 해당 설정을 None으로 설정할 수 있다. 자세한 내용은 HOOK에서 확인할 수 있다. + +``` +default_hooks = dict( + timer=dict(type='IterTimerHook'), # 반복 중에 소요된 시간을 업데이트 + logger=dict(type='LoggerHook', interval=50), # Runner의 다양한 구성 요소에서 로그 데이터를 수집하고 이를 터미널, JSON 파일, 텐서보드, wandb 등으로 기록 + param_scheduler=dict(type='ParamSchedulerHook'), # 최적화 관련 하이퍼파라미터를 업데이트함 + checkpoint=dict(type='CheckpointHook', interval=1), # 주기적으로 체크포인트 저장 + sampler_seed=dict(type='DistSamplerSeedHook'), # 분산 샘플러 셔플이 활성화되었는지 확인 + visualization=dict(type='DetVisualizationHook') # 검증 및 테스트 과정의 예측 결과를 시각화하는 데 사용됨 +) +``` + +`custom_hooks`에서는 `default_hooks`을 제외한 사용자 본인이 원하는 모든 훅을 직접 만들거나 사용할 수 있으며 이를 코드에 삽입하여 실행할 수 있다. + +``` +custom_hooks = [ + dict( + type='EMAHook', + ema_type='ExpMomentumEMA', + momentum=0.0001, + update_buffers=True, + strict_load=False, + priority=49 + ), + dict( + type='mmdet.PipelineSwitchHook', + switch_epoch=max_epochs - close_mosaic_epochs, + switch_pipeline=train_pipeline_stage2 + ), + dict(type='CheckProcessTimePerBlock'), +] +```