rawforge 0.0.2__tar.gz → 0.1.0__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 (22) hide show
  1. {rawforge-0.0.2 → rawforge-0.1.0}/PKG-INFO +1 -1
  2. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/MODEL_REGISTRY.py +8 -9
  3. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/ModelHandler.py +4 -0
  4. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/main.py +4 -1
  5. {rawforge-0.0.2 → rawforge-0.1.0}/pyproject.toml +1 -1
  6. {rawforge-0.0.2 → rawforge-0.1.0}/rawforge.egg-info/PKG-INFO +1 -1
  7. {rawforge-0.0.2 → rawforge-0.1.0}/LICENSE +0 -0
  8. {rawforge-0.0.2 → rawforge-0.1.0}/README.md +0 -0
  9. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/__init__.py +0 -0
  10. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/InferenceWorker.py +0 -0
  11. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/InferenceWorkerRawpy.py +0 -0
  12. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/dng_utils.py +0 -0
  13. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/postprocessing.py +0 -0
  14. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/application/utils.py +0 -0
  15. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/scripts/generate_keys.py +0 -0
  16. {rawforge-0.0.2 → rawforge-0.1.0}/RawForge/scripts/sign_models.py +0 -0
  17. {rawforge-0.0.2 → rawforge-0.1.0}/rawforge.egg-info/SOURCES.txt +0 -0
  18. {rawforge-0.0.2 → rawforge-0.1.0}/rawforge.egg-info/dependency_links.txt +0 -0
  19. {rawforge-0.0.2 → rawforge-0.1.0}/rawforge.egg-info/entry_points.txt +0 -0
  20. {rawforge-0.0.2 → rawforge-0.1.0}/rawforge.egg-info/requires.txt +0 -0
  21. {rawforge-0.0.2 → rawforge-0.1.0}/rawforge.egg-info/top_level.txt +0 -0
  22. {rawforge-0.0.2 → rawforge-0.1.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rawforge
3
- Version: 0.0.2
3
+ Version: 0.1.0
4
4
  Summary: A compute backend/CLI application for using machine learning models on raw images.
5
5
  Author: Ryan Mueller
6
6
  License: MIT License
@@ -1,19 +1,23 @@
1
1
  MODEL_REGISTRY = {
2
2
  "TreeNetDenoise": {
3
3
  "url": "https://github.com/rymuelle/RawRefinery/releases/download/v1.2.1-alpha/ShadowWeightedL1.pt",
4
- "filename": "ShadowWeightedL1.pt"
4
+ "filename": "ShadowWeightedL1.pt",
5
+ "max_iso": 65535,
5
6
  },
6
7
  "TreeNetDenoiseLight": {
7
8
  "url": " https://github.com/rymuelle/RawRefinery/releases/download/v1.2.1-alpha/ShadowWeightedL1_light.pt",
8
- "filename": "ShadowWeightedL1_light.pt"
9
+ "filename": "ShadowWeightedL1_light.pt",
10
+ "max_iso": 65535,
9
11
  },
10
12
  "TreeNetDenoiseSuperLight": {
11
13
  "url": "https://github.com/rymuelle/RawRefinery/releases/download/v1.2.1-alpha/ShadowWeightedL1_super_light.pt",
12
- "filename": "ShadowWeightedL1_super_light.pt"
14
+ "filename": "ShadowWeightedL1_super_light.pt",
15
+ "max_iso": 65535,
13
16
  },
14
17
  "TreeNetDenoiseHeavy": {
15
18
  "url": "https://github.com/rymuelle/RawRefinery/releases/download/v1.2.1-alpha/ShadowWeightedL1_24_deep_500.pt",
16
- "filename": "ShadowWeightedL1_24_deep_500.pt"
19
+ "filename": "ShadowWeightedL1_24_deep_500.pt",
20
+ "max_iso": 65535,
17
21
  },
18
22
  "Deblur": {
19
23
  "url": "https://github.com/rymuelle/RawRefinery/releases/download/v1.2.1-alpha/realblur_gamma_140.pt",
@@ -25,11 +29,6 @@ MODEL_REGISTRY = {
25
29
  "filename": "Deblur_deep_24.pt",
26
30
  "affine": True,
27
31
  },
28
- "test_run_baseline.pt": {
29
- "url": None,
30
- "filename": "test_run_baseline.pt",
31
- "affine": True,
32
- },
33
32
  "TreeNetDenoiseXTrans": {
34
33
  "url": "https://github.com/rymuelle/RawForge/releases/download/xtrans_v1.0.0/xtrans_fixed_exposure_no_conditioning_400.pt",
35
34
  "filename": "xtrans_fixed_exposure_no_conditioning_400.pt",
@@ -113,6 +113,10 @@ class ModelHandler():
113
113
  if not self.model or not self.rh:
114
114
  print("Model or Image not loaded.")
115
115
  return
116
+
117
+ # Some older models were trained with a lower max iso
118
+ if "max_iso" in self.model_params:
119
+ conditioning[0] = min(conditioning[0], self.model_params["max_iso"])
116
120
 
117
121
  if 'backend' in self.model_params and self.model_params['backend'] == 'rawpy':
118
122
  worker = InferenceWorkerRawpy(self.model, self.model_params, self.device, self.rh, conditioning, dims, **inference_kwargs)
@@ -10,7 +10,7 @@ def main():
10
10
  parser.add_argument('model', type=str, help='The name of the model to use.')
11
11
  parser.add_argument('in_file', type=str, help='The name of the file to open.')
12
12
  parser.add_argument('out_file', type=str, help='The name of the file to save.')
13
- parser.add_argument('--conditioning', type=str, help='Conditioning array to feed model.')
13
+ parser.add_argument('--conditioning', type=str, help='Conditioning array to feed model. Input string of numbers like so: 1,2,3')
14
14
  parser.add_argument('--dims', type=int, nargs=4, metavar=("x0", "x1", "y0", "y1"), help='Optional crop dimensions.')
15
15
 
16
16
  parser.add_argument('--cfa', action='store_true', help='Save the image as a CFA image (default: False).')
@@ -42,10 +42,13 @@ def main():
42
42
 
43
43
  if not args.conditioning:
44
44
  conditioning = [iso, 0]
45
+ else:
46
+ conditioning = [int(x) for x in args.conditioning.split(',')]
45
47
 
46
48
  if args.device:
47
49
  handler.set_device(args.device)
48
50
 
51
+
49
52
  inference_kwargs = {"disable_tqdm": args.disable_tqdm,
50
53
  "tile_size": args.tile_size}
51
54
  img, denoised_image = handler.run_inference(conditioning=conditioning, dims=args.dims, inference_kwargs=inference_kwargs)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rawforge"
3
- version = "0.0.2"
3
+ version = "0.1.0"
4
4
  description = "A compute backend/CLI application for using machine learning models on raw images."
5
5
  authors = [
6
6
  { name = "Ryan Mueller"},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rawforge
3
- Version: 0.0.2
3
+ Version: 0.1.0
4
4
  Summary: A compute backend/CLI application for using machine learning models on raw images.
5
5
  Author: Ryan Mueller
6
6
  License: MIT License
File without changes
File without changes
File without changes
File without changes