New YOLOv8 Results() class for prediction outputs (#314)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: Laughing-q <1185102784@qq.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Laughing <61612323+Laughing-q@users.noreply.github.com> Co-authored-by: Viet Nhat Thai <60825385+vietnhatthai@users.noreply.github.com> Co-authored-by: Paula Derrenger <107626595+pderrenger@users.noreply.github.com>
This commit is contained in:
parent
0cb87f7dd3
commit
c6985da9de
32 changed files with 813 additions and 259 deletions
|
|
@ -5,7 +5,6 @@ import inspect
|
|||
import logging.config
|
||||
import os
|
||||
import platform
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
|
|
@ -13,6 +12,7 @@ import uuid
|
|||
from pathlib import Path
|
||||
|
||||
import cv2
|
||||
import git
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import torch
|
||||
|
|
@ -134,10 +134,8 @@ def is_git_directory() -> bool:
|
|||
Returns:
|
||||
bool: True if the current working directory is inside a git repository, False otherwise.
|
||||
"""
|
||||
import git
|
||||
try:
|
||||
from git import Repo
|
||||
Repo(search_parent_directories=True)
|
||||
git.Repo(search_parent_directories=True)
|
||||
# subprocess.run(["git", "rev-parse", "--git-dir"], capture_output=True, check=True) # CLI alternative
|
||||
return True
|
||||
except git.exc.InvalidGitRepositoryError: # subprocess.CalledProcessError:
|
||||
|
|
@ -187,9 +185,10 @@ def get_git_root_dir():
|
|||
If the current file is not part of a git repository, returns None.
|
||||
"""
|
||||
try:
|
||||
output = subprocess.run(["git", "rev-parse", "--git-dir"], capture_output=True, check=True)
|
||||
return Path(output.stdout.strip().decode('utf-8')).parent.resolve() # parent/.git
|
||||
except subprocess.CalledProcessError:
|
||||
# output = subprocess.run(["git", "rev-parse", "--git-dir"], capture_output=True, check=True)
|
||||
# return Path(output.stdout.strip().decode('utf-8')).parent.resolve() # CLI alternative
|
||||
return Path(git.Repo(search_parent_directories=True).working_tree_dir)
|
||||
except git.exc.InvalidGitRepositoryError: # (subprocess.CalledProcessError, FileNotFoundError):
|
||||
return None
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue