gpclipper 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. gpclipper-0.0.2/PKG-INFO +31 -0
  2. gpclipper-0.0.2/gpclipper/MlModules/BaseConfig.py +6 -0
  3. gpclipper-0.0.2/gpclipper/MlModules/BaseModelClass.py +49 -0
  4. gpclipper-0.0.2/gpclipper/MlModules/Clipper/Config.py +827 -0
  5. gpclipper-0.0.2/gpclipper/MlModules/Clipper/GP2Clipper.py +230 -0
  6. gpclipper-0.0.2/gpclipper/MlModules/Clipper/__init__.py +0 -0
  7. gpclipper-0.0.2/gpclipper/MlModules/__init__.py +0 -0
  8. gpclipper-0.0.2/gpclipper/__init__.py +16 -0
  9. gpclipper-0.0.2/gpclipper/clip_shm/__init__.py +1 -0
  10. gpclipper-0.0.2/gpclipper/clip_shm/api.py +289 -0
  11. gpclipper-0.0.2/gpclipper/clip_shm/api_flask.py +318 -0
  12. gpclipper-0.0.2/gpclipper/clip_shm/avg_checkpoints.py +126 -0
  13. gpclipper-0.0.2/gpclipper/clip_shm/clip.py +103 -0
  14. gpclipper-0.0.2/gpclipper/clip_shm/color_transfer_function.py +138 -0
  15. gpclipper-0.0.2/gpclipper/clip_shm/compute.py +26 -0
  16. gpclipper-0.0.2/gpclipper/clip_shm/cp_dataset.py +544 -0
  17. gpclipper-0.0.2/gpclipper/clip_shm/infer_new.py +459 -0
  18. gpclipper-0.0.2/gpclipper/clip_shm/infer_tnet.py +442 -0
  19. gpclipper-0.0.2/gpclipper/clip_shm/infer_vpatch.py +501 -0
  20. gpclipper-0.0.2/gpclipper/clip_shm/makecheckpoint.py +42 -0
  21. gpclipper-0.0.2/gpclipper/clip_shm/mask_crop.py +65 -0
  22. gpclipper-0.0.2/gpclipper/clip_shm/model/M_Net.py +212 -0
  23. gpclipper-0.0.2/gpclipper/clip_shm/model/T_Net_Deeplab.py +56 -0
  24. gpclipper-0.0.2/gpclipper/clip_shm/model/__init__.py +0 -0
  25. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/__init__.py +0 -0
  26. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/aspp.py +96 -0
  27. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/backbone.py +14 -0
  28. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/batchnorm.py +284 -0
  29. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/comm.py +129 -0
  30. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/decoder.py +58 -0
  31. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/deeplab.py +72 -0
  32. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/drn.py +403 -0
  33. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/mobilenet.py +152 -0
  34. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/replicate.py +89 -0
  35. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/resnet.py +163 -0
  36. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/unittest.py +29 -0
  37. gpclipper-0.0.2/gpclipper/clip_shm/model/modeling/xception.py +289 -0
  38. gpclipper-0.0.2/gpclipper/clip_shm/model/network.py +131 -0
  39. gpclipper-0.0.2/gpclipper/clip_shm/pattern_function.py +191 -0
  40. gpclipper-0.0.2/gpclipper/clip_shm/preproc.py +102 -0
  41. gpclipper-0.0.2/gpclipper/clip_shm/segmentation_loss.py +25 -0
  42. gpclipper-0.0.2/gpclipper/clip_shm/temp.py +324 -0
  43. gpclipper-0.0.2/gpclipper/clip_shm/test.py +15 -0
  44. gpclipper-0.0.2/gpclipper/clip_shm/test_api.py +32 -0
  45. gpclipper-0.0.2/gpclipper/clip_shm/train.py +478 -0
  46. gpclipper-0.0.2/gpclipper/clip_shm/utils.py +582 -0
  47. gpclipper-0.0.2/gpclipper/clip_shm/visualization.py +58 -0
  48. gpclipper-0.0.2/gpclipper/error_handler.py +74 -0
  49. gpclipper-0.0.2/gpclipper/helpler/__init__.py +0 -0
  50. gpclipper-0.0.2/gpclipper/helpler/imageHelper.py +758 -0
  51. gpclipper-0.0.2/gpclipper/helpler/localHelper.py +128 -0
  52. gpclipper-0.0.2/gpclipper/helpler/zipHelper.py +416 -0
  53. gpclipper-0.0.2/gpclipper/objdetect_pytorch/__init__.py +1 -0
  54. gpclipper-0.0.2/gpclipper/objdetect_pytorch/api.py +181 -0
  55. gpclipper-0.0.2/gpclipper/objdetect_pytorch/cp_dataset.py +134 -0
  56. gpclipper-0.0.2/gpclipper/objdetect_pytorch/infer.py +101 -0
  57. gpclipper-0.0.2/gpclipper/objdetect_pytorch/model.py +15 -0
  58. gpclipper-0.0.2/gpclipper/objdetect_pytorch/preproc.py +96 -0
  59. gpclipper-0.0.2/gpclipper/objdetect_pytorch/preproc_obj.py +66 -0
  60. gpclipper-0.0.2/gpclipper/objdetect_pytorch/train.py +196 -0
  61. gpclipper-0.0.2/gpclipper/objdetect_pytorch/utils.py +113 -0
  62. gpclipper-0.0.2/gpclipper/process.py +195 -0
  63. gpclipper-0.0.2/gpclipper/unit_test.py +71 -0
  64. gpclipper-0.0.2/gpclipper/unit_test_local.py +51 -0
  65. gpclipper-0.0.2/gpclipper.egg-info/PKG-INFO +31 -0
  66. gpclipper-0.0.2/gpclipper.egg-info/SOURCES.txt +69 -0
  67. gpclipper-0.0.2/gpclipper.egg-info/dependency_links.txt +1 -0
  68. gpclipper-0.0.2/gpclipper.egg-info/requires.txt +13 -0
  69. gpclipper-0.0.2/gpclipper.egg-info/top_level.txt +1 -0
  70. gpclipper-0.0.2/setup.cfg +4 -0
  71. gpclipper-0.0.2/setup.py +37 -0
@@ -0,0 +1,31 @@
1
+ Metadata-Version: 2.4
2
+ Name: gpclipper
3
+ Version: 0.0.2
4
+ Summary: Garment clipping (matting) pipeline — GP2Clipper
5
+ Author: sanchi
6
+ Author-email: sanchi@flixstock.com
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.11
9
+ Requires-Python: >=3.8
10
+ Requires-Dist: torch
11
+ Requires-Dist: torchvision
12
+ Requires-Dist: numpy
13
+ Requires-Dist: opencv-python
14
+ Requires-Dist: Pillow
15
+ Requires-Dist: termcolor
16
+ Requires-Dist: scikit-learn
17
+ Requires-Dist: pandas
18
+ Requires-Dist: tqdm
19
+ Requires-Dist: ipdb
20
+ Provides-Extra: train
21
+ Requires-Dist: tensorboardX; extra == "train"
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: provides-extra
27
+ Dynamic: requires-dist
28
+ Dynamic: requires-python
29
+ Dynamic: summary
30
+
31
+ Garment clipping (matting) pipeline — GP2Clipper
@@ -0,0 +1,6 @@
1
+ import os
2
+
3
+ class BaseConfig:
4
+ def __init__(self):
5
+ self.base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
6
+ self.checkpoints_weights_path = os.path.join(self.base_path, "Checkpoints-n-Weights")
@@ -0,0 +1,49 @@
1
+ import os
2
+ import random
3
+ import time
4
+ import sys
5
+ import ssl
6
+ import shutil
7
+ import uuid
8
+ from abc import ABC, abstractmethod
9
+
10
+ from ..helpler.imageHelper import ImageHelper
11
+ from ..helpler.localHelper import LocalContent
12
+ from ..helpler.zipHelper import ZipHelper
13
+
14
+
15
+ class BaseModel(ABC):
16
+ def __init__(self, init_api=True, checkpoints_dir=None):
17
+ self.base_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
18
+ sys.argv = [sys.argv[0]]
19
+ ssl._create_default_https_context = ssl._create_unverified_context
20
+ if checkpoints_dir is not None:
21
+ self.checkpoints_weights_path = os.path.realpath(checkpoints_dir)
22
+ else:
23
+ self.checkpoints_weights_path = os.path.join(self.base_path, "Checkpoints-n-Weights")
24
+ self.env_name = "clipper18_V2"
25
+ self.temp_base_path = os.path.join(self.base_path, "temp")
26
+ os.makedirs(self.temp_base_path, exist_ok=True)
27
+ self.LocalContent = LocalContent
28
+ self.ImageHelper = ImageHelper
29
+ self.ZipHelper = ZipHelper
30
+
31
+ def get_unique_path(self):
32
+ current_time = str(time.time())
33
+ random_value = random.randint(11111, 99999)
34
+ path = os.path.join(self.temp_base_path, current_time + str(random_value))
35
+ if os.path.exists(path):
36
+ return self.get_unique_path()
37
+ os.makedirs(path)
38
+ return path
39
+
40
+ def getUniqueFilename(self, ext):
41
+ return f"{uuid.uuid4()}{ext}"
42
+
43
+ @abstractmethod
44
+ def load_model(self):
45
+ pass
46
+
47
+ @abstractmethod
48
+ def run_model(self):
49
+ pass