diff --git a/cli/fcos/__init__.py b/cli/linnaeus/__init__.py similarity index 100% rename from cli/fcos/__init__.py rename to cli/linnaeus/__init__.py diff --git a/cli/fcos/__main__.py b/cli/linnaeus/__main__.py similarity index 93% rename from cli/fcos/__main__.py rename to cli/linnaeus/__main__.py index 52648b4..68b43ae 100644 --- a/cli/fcos/__main__.py +++ b/cli/linnaeus/__main__.py @@ -2,7 +2,7 @@ import pathlib parser = argparse.ArgumentParser( - prog="FCOS Command Line Tool", + prog="Linnaeus Command Line Tool", description="This tool provides an easy interface for fcos training and running", epilog="" ) @@ -33,14 +33,14 @@ if args.command == "train": try: - from fcos.train import train + from linnaeus.train import train del args.command train(**vars(args)) except ImportError: print("Train Module not included.") elif args.command == "predict": - from fcos.cli import predict + from linnaeus.cli import predict del args.command predict.main(**vars(args)) diff --git a/cli/fcos/cli/__init__.py b/cli/linnaeus/cli/__init__.py similarity index 100% rename from cli/fcos/cli/__init__.py rename to cli/linnaeus/cli/__init__.py diff --git a/cli/fcos/cli/fix_models.py b/cli/linnaeus/cli/fix_models.py similarity index 100% rename from cli/fcos/cli/fix_models.py rename to cli/linnaeus/cli/fix_models.py diff --git a/cli/fcos/cli/predict.py b/cli/linnaeus/cli/predict.py similarity index 87% rename from cli/fcos/cli/predict.py rename to cli/linnaeus/cli/predict.py index 9e21c38..fcf7d81 100644 --- a/cli/fcos/cli/predict.py +++ b/cli/linnaeus/cli/predict.py @@ -1,7 +1,7 @@ -from fcos.core.models import FCOS -from fcos.core.loaders import ClassLoader -from fcos.core.data_augmentation import preprocessing -from fcos.core.mAP.functions import fcos_to_boxes +from linnaeus.core.models import FCOS +from linnaeus.core.loaders import ClassLoader +from linnaeus.core.data_augmentation import preprocessing +from linnaeus.core.mAP.functions import fcos_to_boxes import numpy as np import torch import cv2 diff --git a/cli/poetry.lock b/cli/poetry.lock index 38cc2f0..3d4c83a 100644 --- a/cli/poetry.lock +++ b/cli/poetry.lock @@ -123,7 +123,7 @@ files = [ ] [[package]] -name = "fcos-core" +name = "linnaeus-core" version = "0.1.7" description = "" category = "main" @@ -142,7 +142,7 @@ type = "directory" url = "../core" [[package]] -name = "fcos-train" +name = "linnaeus-train" version = "0.1.7" description = "" category = "main" @@ -152,7 +152,7 @@ files = [] develop = false [package.dependencies] -fcos-core = {path = "../core"} +linnaeus-core = {path = "../core"} tqdm = "^4.64.1" [package.source] @@ -443,7 +443,7 @@ secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "p socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [extras] -train = ["fcos-train"] +train = ["linnaeus-train"] [metadata] lock-version = "2.0" diff --git a/cli/pyproject.toml b/cli/pyproject.toml index 3d03266..1bbfc65 100644 --- a/cli/pyproject.toml +++ b/cli/pyproject.toml @@ -1,19 +1,19 @@ [tool.poetry] -name = "fcos-cli" +name = "linnaeus-cli" version = "0.1.0" description = "" authors = ["DTheLegend "] readme = "README.md" -packages = [{include = "fcos"}] +packages = [{include = "linnaeus"}] [tool.poetry.dependencies] python = "3.10.6" -fcos-core = {path = "../core"} -fcos-train = {path = "../train", optional=true} +linnaeus-core = {path = "../core"} +linnaeus-train = {path = "../train", optional=true} [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry.extras] -train = ["fcos-train"] +train = ["linnaeus-train"] diff --git a/core/fcos/__init__.py b/core/linnaeus/__init__.py similarity index 100% rename from core/fcos/__init__.py rename to core/linnaeus/__init__.py diff --git a/core/fcos/core/__init__.py b/core/linnaeus/core/__init__.py similarity index 100% rename from core/fcos/core/__init__.py rename to core/linnaeus/core/__init__.py diff --git a/core/fcos/core/data_augmentation.py b/core/linnaeus/core/data_augmentation.py similarity index 100% rename from core/fcos/core/data_augmentation.py rename to core/linnaeus/core/data_augmentation.py diff --git a/core/fcos/core/loaders/__init__.py b/core/linnaeus/core/loaders/__init__.py similarity index 100% rename from core/fcos/core/loaders/__init__.py rename to core/linnaeus/core/loaders/__init__.py diff --git a/core/fcos/core/loaders/class_loader.py b/core/linnaeus/core/loaders/class_loader.py similarity index 100% rename from core/fcos/core/loaders/class_loader.py rename to core/linnaeus/core/loaders/class_loader.py diff --git a/core/fcos/core/loaders/folder_data_set_loader.py b/core/linnaeus/core/loaders/folder_data_set_loader.py similarity index 97% rename from core/fcos/core/loaders/folder_data_set_loader.py rename to core/linnaeus/core/loaders/folder_data_set_loader.py index 2b53dad..09e3937 100644 --- a/core/fcos/core/loaders/folder_data_set_loader.py +++ b/core/linnaeus/core/loaders/folder_data_set_loader.py @@ -5,7 +5,7 @@ from torch.utils.data import Dataset from pathlib import Path -from fcos.core.data_augmentation import preprocessing +from linnaeus.core.data_augmentation import preprocessing class FolderDataSetLoader(Dataset): diff --git a/core/fcos/core/mAP/__init__.py b/core/linnaeus/core/mAP/__init__.py similarity index 100% rename from core/fcos/core/mAP/__init__.py rename to core/linnaeus/core/mAP/__init__.py diff --git a/core/fcos/core/mAP/classes.py b/core/linnaeus/core/mAP/classes.py similarity index 100% rename from core/fcos/core/mAP/classes.py rename to core/linnaeus/core/mAP/classes.py diff --git a/core/fcos/core/mAP/functions.py b/core/linnaeus/core/mAP/functions.py similarity index 98% rename from core/fcos/core/mAP/functions.py rename to core/linnaeus/core/mAP/functions.py index fc43820..4d2518f 100644 --- a/core/fcos/core/mAP/functions.py +++ b/core/linnaeus/core/mAP/functions.py @@ -142,6 +142,7 @@ def return_mAP(model, dataset, classes): col = cuda_image.shape[3] confs, locs, centers = model(cuda_image) boxes = fcos_to_boxes(classes, confs, locs, centers, row, col) + boxes.sort(key=take2, reverse=True) for gt_box in tags: box_class = classes[int(gt_box[0].item())] gt_count_all[box_class] += 1 @@ -152,6 +153,7 @@ def return_mAP(model, dataset, classes): mp = 0 mr = 0 for c in classes: + mAP_all[c].sort(key=take2, reverse=True) p, r, ap = compute_mAP(mAP_all[c], gt_count_all[c]) mAP += ap * gt_count_all[c] mp += p * gt_count_all[c] diff --git a/core/fcos/core/models/__init__.py b/core/linnaeus/core/models/__init__.py similarity index 100% rename from core/fcos/core/models/__init__.py rename to core/linnaeus/core/models/__init__.py diff --git a/core/fcos/core/models/fcos.py b/core/linnaeus/core/models/fcos.py similarity index 100% rename from core/fcos/core/models/fcos.py rename to core/linnaeus/core/models/fcos.py diff --git a/core/pyproject.toml b/core/pyproject.toml index 0a84bc8..21384ca 100644 --- a/core/pyproject.toml +++ b/core/pyproject.toml @@ -1,10 +1,10 @@ [tool.poetry] -name = "fcos-core" +name = "linnaeus-core" version = "0.1.7" description = "" authors = ["DTheLegend "] readme = "README.md" -packages = [{include = "fcos"}] +packages = [{include = "linnaeus"}] [tool.poetry.dependencies] python = "3.10.6" diff --git a/main/poetry.lock b/main/poetry.lock index 4bc359e..ea334dc 100644 --- a/main/poetry.lock +++ b/main/poetry.lock @@ -123,7 +123,19 @@ files = [ ] [[package]] -name = "fcos-cli" +name = "idna" +version = "3.4" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=3.5" +files = [ + {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, + {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, +] + +[[package]] +name = "linnaeus-cli" version = "0.1.0" description = "" category = "main" @@ -133,17 +145,17 @@ files = [] develop = false [package.dependencies] -fcos-core = {path = "../core"} +linnaeus-core = {path = "../core"} [package.extras] -train = ["fcos-train @ file:///C:/Users/wampa/Documents/Coding%20Projects/Unnamed/train"] +train = ["linnaeus-train @ file:///C:/Users/wampa/Documents/Coding%20Projects/Unnamed/train"] [package.source] type = "directory" url = "../cli" [[package]] -name = "fcos-core" +name = "linnaeus-core" version = "0.1.7" description = "" category = "main" @@ -162,7 +174,7 @@ type = "directory" url = "../core" [[package]] -name = "fcos-train" +name = "linnaeus-train" version = "0.1.7" description = "" category = "main" @@ -172,25 +184,13 @@ files = [] develop = false [package.dependencies] -fcos-core = {path = "../core"} +linnaeus-core = {path = "../core"} tqdm = "^4.64.1" [package.source] type = "directory" url = "../train" -[[package]] -name = "idna" -version = "3.4" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" -optional = false -python-versions = ">=3.5" -files = [ - {file = "idna-3.4-py3-none-any.whl", hash = "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2"}, - {file = "idna-3.4.tar.gz", hash = "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"}, -] - [[package]] name = "numpy" version = "1.24.2" @@ -465,10 +465,10 @@ secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "p socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] [extras] -cli = ["fcos-cli"] -train = ["fcos-train"] +cli = ["linnaeus-cli"] +train = ["linnaeus-train"] [metadata] lock-version = "2.0" python-versions = "3.10.6" -content-hash = "873ca51da785d98254b6dcc7dcd6a101741a8fd9372639b59022726702febc70" +content-hash = "e863f4c1f6f717191fd31914cde446f53eeb63de3f006289fbe1ed3fe3b6876b" diff --git a/main/pyproject.toml b/main/pyproject.toml index c28ba6a..cd3c916 100644 --- a/main/pyproject.toml +++ b/main/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "fcos" +name = "linnaeus" version = "0.1.0" description = "" authors = ["DTheLegend "] @@ -7,14 +7,14 @@ readme = "README.md" [tool.poetry.dependencies] python = "3.10.6" -fcos-core = {path = "../core"} -fcos-cli = {path = "../cli", optional=true} -fcos-train = {path = "../train", optional=true} +linnaeus-core = {path = "../core"} +linnaeus-cli = {path = "../cli", optional=true} +linnaeus-train = {path = "../train", optional=true} [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" [tool.poetry.extras] -cli = ["fcos-cli"] -train = ["fcos-train"] +cli = ["linnaeus-cli"] +train = ["linnaeus-train"] diff --git a/train/fcos/__init__.py b/train/linnaeus/__init__.py similarity index 100% rename from train/fcos/__init__.py rename to train/linnaeus/__init__.py diff --git a/train/fcos/train/__init__.py b/train/linnaeus/train/__init__.py similarity index 100% rename from train/fcos/train/__init__.py rename to train/linnaeus/train/__init__.py diff --git a/train/fcos/train/loss/__init__.py b/train/linnaeus/train/loss/__init__.py similarity index 100% rename from train/fcos/train/loss/__init__.py rename to train/linnaeus/train/loss/__init__.py diff --git a/train/fcos/train/loss/fcos_loss.py b/train/linnaeus/train/loss/fcos_loss.py similarity index 99% rename from train/fcos/train/loss/fcos_loss.py rename to train/linnaeus/train/loss/fcos_loss.py index 9c3a4bc..8f62692 100644 --- a/train/fcos/train/loss/fcos_loss.py +++ b/train/linnaeus/train/loss/fcos_loss.py @@ -1,6 +1,6 @@ import torch import torch.nn as nn -from fcos.core.mAP import MapMaster +from linnaeus.core.mAP import MapMaster from .iou_loss import IOULoss class FCOSLoss(nn.Module): diff --git a/train/fcos/train/loss/iou_loss.py b/train/linnaeus/train/loss/iou_loss.py similarity index 100% rename from train/fcos/train/loss/iou_loss.py rename to train/linnaeus/train/loss/iou_loss.py diff --git a/train/fcos/train/train.py b/train/linnaeus/train/train.py similarity index 96% rename from train/fcos/train/train.py rename to train/linnaeus/train/train.py index c45c2a4..e5ea476 100644 --- a/train/fcos/train/train.py +++ b/train/linnaeus/train/train.py @@ -1,7 +1,7 @@ import torch -from fcos.core.loaders import FolderDataSetLoader, ClassLoader -from fcos.train.loss import FCOSLoss -from fcos.core.models import FCOS +from linnaeus.core.loaders import FolderDataSetLoader, ClassLoader +from linnaeus.train.loss import FCOSLoss +from linnaeus.core.models import FCOS import torch.utils.data as Data import os from fcos.core.mAP import return_mAP diff --git a/train/poetry.lock b/train/poetry.lock index c9af0e8..52d43dc 100644 --- a/train/poetry.lock +++ b/train/poetry.lock @@ -123,7 +123,7 @@ files = [ ] [[package]] -name = "fcos-core" +name = "linnaeus-core" version = "0.1.4" description = "" category = "main" diff --git a/train/pyproject.toml b/train/pyproject.toml index 03a3044..cc3305e 100644 --- a/train/pyproject.toml +++ b/train/pyproject.toml @@ -1,14 +1,14 @@ [tool.poetry] -name = "fcos-train" +name = "linnaeus-train" version = "0.1.7" description = "" authors = ["DTheLegend "] readme = "README.md" -packages = [{include = "fcos"}] +packages = [{include = "linnaeus"}] [tool.poetry.dependencies] python = "3.10.6" -fcos-core= {path = "../core"} +linnaeus-core= {path = "../core"} tqdm = "^4.64.1"