sejong-rcv / 2022.infra.evalai-starters Goto Github PK
View Code? Open in Web Editor NEWhttp://203.250.148.128:3088 사용법입니다.
http://203.250.148.128:3088 사용법입니다.
현재 서버에 설치된 패키지는 아래와 같습니다.
평가코드 작성시, 필요한 패키지가 있다면 이슈에 남겨주시면 확인 후 추가하겠습니다. 가급적이면 패키지 공식 문서 URL과 함께 부탁드립니다.
다른 것에서는 괜찮았는데 이 부분에서 json을 안해봤어서 그런지 애로사항이 있었습니다.
이 부분에서 도움되시라고 MNIST 예제로 변형시켜서 올려봅니다.
한 번 리더보드에 점수 띄워보시고 본인의 테스크에 맞게 구상하셔서 바꿔서 코딩하시면 될 것 같습니다.
# --- #
# 리더보드의 평가 메트릭 관한 부분 #
# 평가 매트릭 이름을 여기서 입력합니다. #
# 평가는 evalutaion_script/main.py에서 작성한 코드로 하고, 리더보드 자체는 맨 아래에서 만듭니다. #
leaderboard:
- id: 1
schema:
{
"labels": ["pred_avg"],
"default_order_by": "pred_avg",
# --- #
# 리더보드에 설명을 붙이고싶으면 아래와 같이 가능합니다. #
# 오름차순 내림차순 설정과, 간단한 설명을 리더보드 페이지에 추가할 수 있습니다. #
"metadata": {
"pred_avg": {
"sort_ascending": True,
"description": "Recall@1 is defined as the ratio of correctly retrieved queries
within the top 1 predictions to the total number of queries ",
}
}
# --- #
}
test_annotation_file: annotations/test.json
codename: dev
allowed_submission_file_types: ".json"
dataset_splits:
- id: 1
name: Test Split
codename: test_split
# --- #
import random
import json
import numpy as np
def evaluate(test_annotation_file, user_submission_file, phase_codename, **kwargs):
print("Starting Evaluation.....")
# --- #
# test_annotation_file == challenge_config.yaml에서 설정한 정답 파일 #
# user_submission_file == 유저가 사이트에서 업로드할 파일 #
# phase_codename = challenge_config에서 설정하였음
# --- #
# --- #
# 아래 output에 결과를 입력하고 return하면 사이트내 리더보드에 올라갑니다. #
# output의 양식은 본인이 challenge_config.yaml에서 설정한 dataset_splits과 leaderboard(평가 메트릭)에 맞추시면 됩니다. #
output = {}
if phase_codename == "dev":
# --- #
# "dataset_splits" : { leaderboard's labels : 000 } #
# 와 같은 형태로 입력해야합니다. #
# challenge_config.yaml의 이름과 동일한지 꼭 확인해주세요 #
print("MNIST Evaluation...")
answer_path = test_annotation_file
test_path = user_submission_file
with open(answer_path, "r") as gt_path:
ground_truth = json.load(gt_path)
with open(test_path, "r") as pred_path:
predictions = json.load(pred_path)
correct = 0.0
for idx in range(len(ground_truth["mnist"])):
pred = predictions["mnist"][idx]["pred"]
gt = ground_truth['mnist'][idx]['pred']
if pred == gt:
correct += 1
else:
pass
avg = correct / len(ground_truth["mnist"])
output["result"] = [
{
"test_split": {
"pred_avg": avg
}
}
]
# --- #
# To display the results in the result file
output["submission_result"] = output["result"][0]["test_split"]
print("Completed evaluation")
return output
{
"mnist": [
{
"id" : 0, "pred" : 0
},
{
"id" : 1, "pred" : 1
},
{
"id" : 2, "pred" : 2
},
{
"id" : 3, "pred" : 3
},
{
"id" : 4, "pred" : 4
},
{
"id" : 5, "pred" : 5
},
{
"id" : 6, "pred" : 6
},
{
"id" : 7, "pred" : 7
},
{
"id" : 8, "pred" : 8
},
{
"id": 9, "pred": 9
}
]
}
{
"mnist": [
{
"id" : 0, "pred" : 0
},
{
"id" : 1, "pred" : 1
},
{
"id" : 2, "pred" : 2
},
{
"id" : 3, "pred" : 3
},
{
"id" : 4, "pred" : 4
},
{
"id" : 5, "pred" : 5
},
{
"id" : 6, "pred" : 6
},
{
"id" : 7, "pred" : 7
},
{
"id" : 8, "pred" : 8
},
{
"id" : 9, "pred" : 8
}
]
}
├── evaluation_script.zip # Contains the evaluation scripts
├── challenge_config.yaml # Configuration file to define challenge setup
├── logo.jpg # Logo image of the challenge
├── submission.json # Sample submission file
├── run.sh # Script to create the challenge configuration zip to be uploaded on EvalAI website
├── annotations # Contains the annotations for Dataset splits
│ ├── test_annotations_devsplit.json # Annotations of dev split
│ └── test_annotations_testsplit.json # Annotations for test split
└── templates # Contains challenge related HTML templates
├── challenge_phase_1_description.html # Challenge Phase 1 description template
├── challenge_phase_2_description.html # Challenge Phase 2 description template
├── description.html # Challenge description template
├── evaluation_details.html # Contains description about how submissions will be evalauted for each challenge phase
├── submission_guidelines.html # Contains information about how to make submissions to the challenge
└── terms_and_conditions.html # Contains terms and conditions related to the challenge
윈도우에서는 run.sh
가 제대로 실행되지 않습니다. 위의 파일 경로를 참고하셔서 직접 압축을 수행하시면 챌린지 파일을 만드실 수 있습니다. "evalutaion_script" 폴더만 따로 압축하신 후에 폴더에 있는 파일을 압축하시면 됩니다.
크롬에서 사용 중인 각종 플러그인들 중 일부 플러그인을 사용할 경우 Overview등이 수정되지 않을 수 있습니다. 플러그인을 끄신 상태로 수정을 시도해주세요.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.