Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e113c7ddf | ||
|
|
3d518814c5 | ||
|
|
93fa012472 | ||
|
|
45a0a794e7 | ||
|
|
18627b61da | ||
|
|
e98d072256 | ||
|
|
fa1f9ceed2 | ||
|
|
1ac7969b3a | ||
|
|
08bd87a9db | ||
|
|
cd8318fba5 | ||
|
|
97f53246d6 | ||
|
|
9546f22209 | ||
|
|
9e950d2c26 | ||
|
|
aedc56408a | ||
|
|
16216a663d |
No files matched your search
@@ -0,0 +1,200 @@
|
||||
name: Dependabot Auto Merge
|
||||
|
||||
on:
|
||||
check_suite:
|
||||
types: [completed]
|
||||
workflow_run:
|
||||
workflows:
|
||||
- "CodeQL"
|
||||
types:
|
||||
- completed
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch || github.run_id }}
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
checks: read
|
||||
statuses: read
|
||||
|
||||
jobs:
|
||||
merge:
|
||||
name: Auto-merge Dependabot PRs
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Merge Dependabot PRs when checks pass
|
||||
uses: actions/github-script@v9
|
||||
with:
|
||||
script: |
|
||||
const owner = context.repo.owner;
|
||||
const repo = context.repo.repo;
|
||||
|
||||
const successfulCheckConclusions = new Set(["success", "skipped", "neutral"]);
|
||||
const successfulStatusStates = new Set(["success"]);
|
||||
const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
||||
|
||||
const latestBy = (items, keyOf, timeOf) => {
|
||||
const latest = new Map();
|
||||
for (const item of items) {
|
||||
const key = keyOf(item);
|
||||
const itemTime = new Date(timeOf(item) || 0).getTime();
|
||||
const existing = latest.get(key);
|
||||
const existingTime = existing ? new Date(timeOf(existing) || 0).getTime() : -1;
|
||||
if (!existing || itemTime >= existingTime) {
|
||||
latest.set(key, item);
|
||||
}
|
||||
}
|
||||
return [...latest.values()];
|
||||
};
|
||||
|
||||
const findCandidatePulls = async () => {
|
||||
const pulls = await github.paginate(github.rest.pulls.list, {
|
||||
owner,
|
||||
repo,
|
||||
state: "open",
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
return pulls.filter((pr) => pr.user?.login === "dependabot[bot]");
|
||||
};
|
||||
|
||||
const getMergeablePullRequest = async (pull_number) => {
|
||||
for (let attempt = 1; attempt <= 6; attempt += 1) {
|
||||
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
|
||||
if (pr.mergeable !== null) {
|
||||
return pr;
|
||||
}
|
||||
core.info("PR #" + pull_number + " mergeability is still being computed; retry " + attempt + "/6.");
|
||||
await wait(5000);
|
||||
}
|
||||
|
||||
const { data: pr } = await github.rest.pulls.get({ owner, repo, pull_number });
|
||||
return pr;
|
||||
};
|
||||
|
||||
const getSignalState = async (sha) => {
|
||||
const checkRuns = await github.paginate(github.rest.checks.listForRef, {
|
||||
owner,
|
||||
repo,
|
||||
ref: sha,
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
const statuses = await github.paginate(github.rest.repos.listCommitStatusesForRef, {
|
||||
owner,
|
||||
repo,
|
||||
ref: sha,
|
||||
per_page: 100,
|
||||
});
|
||||
|
||||
const latestChecks = latestBy(
|
||||
checkRuns.filter((run) => run.name !== "Dependabot Auto Merge"),
|
||||
(run) => (run.app?.slug || "unknown") + ":" + run.name,
|
||||
(run) => run.completed_at || run.started_at || run.created_at,
|
||||
);
|
||||
const latestStatuses = latestBy(statuses, (status) => status.context, (status) => status.updated_at || status.created_at);
|
||||
|
||||
const pendingChecks = latestChecks.filter((run) => run.status !== "completed");
|
||||
const failedChecks = latestChecks.filter(
|
||||
(run) => run.status === "completed" && !successfulCheckConclusions.has(String(run.conclusion || "").toLowerCase()),
|
||||
);
|
||||
const failedStatuses = latestStatuses.filter((status) => !successfulStatusStates.has(String(status.state || "").toLowerCase()));
|
||||
|
||||
return {
|
||||
totalSignals: latestChecks.length + latestStatuses.length,
|
||||
pendingChecks,
|
||||
failedChecks,
|
||||
failedStatuses,
|
||||
};
|
||||
};
|
||||
|
||||
const { data: repository } = await github.rest.repos.get({ owner, repo });
|
||||
const mergeMethods = [];
|
||||
if (repository.allow_merge_commit) mergeMethods.push("merge");
|
||||
if (repository.allow_squash_merge) mergeMethods.push("squash");
|
||||
if (repository.allow_rebase_merge) mergeMethods.push("rebase");
|
||||
|
||||
if (mergeMethods.length === 0) {
|
||||
core.info("This repository has no enabled pull request merge methods.");
|
||||
return;
|
||||
}
|
||||
|
||||
const pulls = await findCandidatePulls();
|
||||
if (pulls.length === 0) {
|
||||
core.info("No open Dependabot PRs to evaluate.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (const candidate of pulls) {
|
||||
const pull_number = candidate.number;
|
||||
const pr = await getMergeablePullRequest(pull_number);
|
||||
|
||||
if (pr.user?.login !== "dependabot[bot]") {
|
||||
core.info("PR #" + pull_number + " is no longer a Dependabot PR.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pr.state !== "open" || pr.draft) {
|
||||
core.info("PR #" + pull_number + " is not an open, ready PR.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pr.mergeable !== true) {
|
||||
core.info("PR #" + pull_number + " is not currently mergeable.");
|
||||
continue;
|
||||
}
|
||||
|
||||
const signalState = await getSignalState(pr.head.sha);
|
||||
if (signalState.totalSignals === 0) {
|
||||
core.info("PR #" + pull_number + " has no checks or statuses yet; skipping.");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (signalState.pendingChecks.length > 0) {
|
||||
core.info("PR #" + pull_number + " still has pending checks: " + signalState.pendingChecks.map((run) => run.name).join(", ") + ".");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (signalState.failedChecks.length > 0 || signalState.failedStatuses.length > 0) {
|
||||
const failedChecks = signalState.failedChecks.map((run) => run.name + "=" + run.conclusion).join(", ");
|
||||
const failedStatuses = signalState.failedStatuses.map((status) => status.context + "=" + status.state).join(", ");
|
||||
core.info("PR #" + pull_number + " is not green. Checks: " + (failedChecks || "none") + ". Statuses: " + (failedStatuses || "none") + ".");
|
||||
continue;
|
||||
}
|
||||
|
||||
let merged = false;
|
||||
let lastError = null;
|
||||
for (const merge_method of mergeMethods) {
|
||||
try {
|
||||
await github.rest.pulls.merge({ owner, repo, pull_number, merge_method });
|
||||
core.info("Merged Dependabot PR #" + pull_number + " with " + merge_method + ".");
|
||||
merged = true;
|
||||
break;
|
||||
} catch (error) {
|
||||
lastError = error;
|
||||
if (error.status === 403 || error.status === 405 || error.status === 409) {
|
||||
core.info("Cannot merge PR #" + pull_number + " with " + merge_method + ": " + error.message);
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
if (!merged) {
|
||||
core.info("PR #" + pull_number + " could not be merged: " + (lastError?.message || "unknown error") + ".");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pr.head.repo?.full_name === owner + "/" + repo) {
|
||||
try {
|
||||
await github.rest.git.deleteRef({ owner, repo, ref: "heads/" + pr.head.ref });
|
||||
core.info("Deleted branch " + pr.head.ref + ".");
|
||||
} catch (error) {
|
||||
core.info("Could not delete branch " + pr.head.ref + ": " + error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,8 +155,6 @@ cython_debug/
|
||||
# Some derectories to ignore
|
||||
/dataset.7z
|
||||
/dataset
|
||||
/evaluation
|
||||
/results
|
||||
/runs
|
||||
/visualizations
|
||||
/weights
|
||||
@@ -21,7 +21,7 @@ A comprehensive framework for training and evaluating YOLO models on the TinyPer
|
||||
1. Clone the repository:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/yourusername/YOLO-TinyPerson.git
|
||||
git clone https://github.com/xixu-me/YOLO-TinyPerson.git
|
||||
cd YOLO-TinyPerson
|
||||
```
|
||||
|
||||
@@ -138,6 +138,6 @@ The following YOLO models are supported:
|
||||
|
||||
## License
|
||||
|
||||
Copyright © [Xi Xu](https://xi-xu.me). All rights reserved.
|
||||
Copyright © [Xi Xu](https://xi-xu.me)
|
||||
|
||||
Licensed under the [GPL-3.0](LICENSE) license.
|
||||
@@ -26,7 +26,7 @@ COLORS = {
|
||||
}
|
||||
|
||||
# ----- Output Directories -----
|
||||
EVAL_DIR = "evaluation"
|
||||
EVAL_DIR = "evaluations"
|
||||
PLOTS_DIR = os.path.join(EVAL_DIR, "plots")
|
||||
os.makedirs(EVAL_DIR, exist_ok=True)
|
||||
os.makedirs(PLOTS_DIR, exist_ok=True)
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
model,precision,recall,mAP50,mAP50-95,f1_score,mean_IoU,inference_time,inference_fps,model_size_mb
|
||||
YOLOv8x,0.5802750308354792,0.19604673806965306,0.39102214562486115,0.16070488676786066,0.29307699853463975,0,0.04080785989761353,24.505083150868217,130.39116191864014
|
||||
YOLOv9e,0.5858803066254644,0.19183239864264118,0.3915246494612059,0.16146398598283707,0.289029158869797,0,0.02869248628616333,34.8523299802792,111.83285713195801
|
||||
YOLOv10x,0.5657525792482877,0.18632740793939978,0.3752592305942457,0.156037127850175,0.2803297878102947,0,0.024821592966715496,40.28750295522731,61.12803840637207
|
||||
YOLO11x,0.5568671314564757,0.20058049557556173,0.3771942805437813,0.15638678521327326,0.2949291309293667,0,0.025052271684010825,39.91653980977033,109.09468269348145
|
||||
YOLO12x,0.5803901762700486,0.18269323730176718,0.3826259183074694,0.16225306064175796,0.2779076528231838,0,0.028874218463897705,34.632972014474774,113.5777530670166
|
||||
|
|
After Width: | Height: | Size: 125 KiB |
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 154 KiB |
|
After Width: | Height: | Size: 501 KiB |
@@ -3,3 +3,4 @@ numpy>=1.22.0
|
||||
pandas>=1.5.0
|
||||
matplotlib>=3.5.0
|
||||
requests>=2.28.0
|
||||
ultralytics>=8.3.146
|
||||
@@ -5,11 +5,11 @@ from ultralytics import YOLO
|
||||
|
||||
# ===== Model Configuration =====
|
||||
MODELS = [
|
||||
{"name": "YOLOv8x", "model_path": "weights/yolov8x.pt", "epochs": 2},
|
||||
{"name": "YOLOv9e", "model_path": "weights/yolov9e.pt", "epochs": 2},
|
||||
{"name": "YOLOv10x", "model_path": "weights/yolov10x.pt", "epochs": 2},
|
||||
{"name": "YOLO11x", "model_path": "weights/yolo11x.pt", "epochs": 2},
|
||||
{"name": "YOLO12x", "model_path": "weights/yolo12x.pt", "epochs": 2},
|
||||
{"name": "YOLOv8x", "model_path": "weights/yolov8x.pt", "epochs": 100},
|
||||
{"name": "YOLOv9e", "model_path": "weights/yolov9e.pt", "epochs": 100},
|
||||
{"name": "YOLOv10x", "model_path": "weights/yolov10x.pt", "epochs": 100},
|
||||
{"name": "YOLO11x", "model_path": "weights/yolo11x.pt", "epochs": 100},
|
||||
{"name": "YOLO12x", "model_path": "weights/yolo12x.pt", "epochs": 100},
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 340 KiB |
|
After Width: | Height: | Size: 320 KiB |
|
After Width: | Height: | Size: 704 KiB |
|
After Width: | Height: | Size: 313 KiB |
|
After Width: | Height: | Size: 186 KiB |
|
After Width: | Height: | Size: 544 KiB |
|
After Width: | Height: | Size: 403 KiB |
|
After Width: | Height: | Size: 275 KiB |
|
After Width: | Height: | Size: 335 KiB |