Giter VIP home page Giter VIP logo

Comments (4)

lext avatar lext commented on August 26, 2024 1

I think I have found the bug. The fixed version is now in master.

from solt.

lext avatar lext commented on August 26, 2024

Doesn't it work already if you use from_yaml? https://oulu-imeds.github.io/solt/utils.html#solt.utils.from_yaml

from solt.

aisosalo avatar aisosalo commented on August 26, 2024

For the transform resize I am getting the following error message when reading the attached transformation stream:

>> solt.__version__
'0.1.9'
>> solt.utils.from_yaml('trf.yaml')
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/home/user/anaconda3/envs/py37_env/lib/python3.7/site-packages/solt/utils/_utils.py", line 171, in from_yaml
    return from_dict(d)
  File "/home/user/anaconda3/envs/py37_env/lib/python3.7/site-packages/solt/utils/_utils.py", line 112, in from_dict
    transforms[t]["transforms"] = [from_dict(x) for x in transforms[t]["transforms"]]
  File "/home/user/anaconda3/envs/py37_env/lib/python3.7/site-packages/solt/utils/_utils.py", line 112, in <listcomp>
    transforms[t]["transforms"] = [from_dict(x) for x in transforms[t]["transforms"]]
  File "/home/user/anaconda3/envs/py37_env/lib/python3.7/site-packages/solt/utils/_utils.py", line 120, in from_dict
    return cls(**transforms[t])
  File "/home/user/anaconda3/envs/py37_env/lib/python3.7/site-packages/solt/transforms/_transforms.py", line 635, in __init__
    raise TypeError("The argument resize_to has an incorrect type!")
TypeError: The argument resize_to has an incorrect type!

Perhaps I am doing something wrong?

Transformation stream (resulting originally from print(stream.to_yaml()) with codes &id001 and *id001 commented out):

stream:
  ignore_fast_mode: false
  interpolation: null
  optimize_stack: false
  padding: null
  transforms:
  - resize:
      interpolation:
      - bilinear
      - inherit
      resize_to: #&id001
      - 1920
      - 2944
  - projection:
      affine_transforms:
        stream:
          ignore_fast_mode: false
          interpolation: null
          optimize_stack: false
          padding: null
          transforms:
          - rotate:
              angle_range:
              - -3
              - 3
              ignore_fast_mode: false
              ignore_state: true
              interpolation:
              - bilinear
              - inherit
              p: 0.5
              padding:
              - z
              - inherit
          - scale:
              ignore_fast_mode: false
              ignore_state: true
              interpolation:
              - bilinear
              - inherit
              p: 0.5
              padding:
              - z
              - inherit
              range_x:
              - 0.6
              - 1.4
              range_y:
              - 0.6
              - 1.4
              same: false
          - shear:
              ignore_fast_mode: false
              ignore_state: true
              interpolation:
              - bilinear
              - inherit
              p: 0.5
              padding:
              - z
              - inherit
              range_x:
              - -0.6
              - 0.6
              range_y:
              - -0.6
              - 0.6
          - translate:
              ignore_fast_mode: false
              ignore_state: true
              interpolation:
              - bilinear
              - inherit
              p: 0.5
              padding:
              - z
              - inherit
              range_x:
              - -50
              - 50
              range_y:
              - -50
              - 50
      ignore_fast_mode: false
      ignore_state: true
      interpolation:
      - bilinear
      - inherit
      p: 0.5
      padding:
      - z
      - inherit
  - pad:
      pad_to: #*id001
      - 1920
      - 2944
      padding:
      - z
      - inherit
  - crop:
      crop_mode: r
  - flip:
      axis: 1
      data_indices: null
      p: 0.5
  - selective_stream:
      ignore_fast_mode: false
      n: 1
      optimize_stack: false
      probs: null
      transforms:
      - cutout:
          cutout_size:
          - 384
          - 588
          data_indices: null
          p: 0.5
  - selective_stream:
      ignore_fast_mode: false
      n: 1
      optimize_stack: false
      probs: null
      transforms:
      - noise:
          data_indices: null
          gain_range:
          - 0
          - 0.1
          p: 0.5
      - selective_stream:
          ignore_fast_mode: false
          n: 1
          optimize_stack: false
          probs: null
          transforms:
          - blur:
              data_indices: null
              gaussian_sigma:
              - 1
              - 2
              k_size:
              - 3
              - 7
              - 11
              p: 0.5

from solt.

lext avatar lext commented on August 26, 2024

This test passes:

def test_complex_transform_serialization():
. Can you try to localize the bug?

from solt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.