Browse Source

add folders and CMakeLists for audio operators

pull/15397/head
Xiao Tianci 4 years ago
parent
commit
5a9622387c
15 changed files with 232 additions and 0 deletions
  1. +5
    -0
      mindspore/ccsrc/minddata/dataset/CMakeLists.txt
  2. +2
    -0
      mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt
  3. +26
    -0
      mindspore/ccsrc/minddata/dataset/api/audio.cc
  4. +24
    -0
      mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/audio/kernels/ir/bindings.cc
  5. +5
    -0
      mindspore/ccsrc/minddata/dataset/audio/CMakeLists.txt
  6. +4
    -0
      mindspore/ccsrc/minddata/dataset/audio/ir/CMakeLists.txt
  7. +6
    -0
      mindspore/ccsrc/minddata/dataset/audio/ir/kernels/CMakeLists.txt
  8. +24
    -0
      mindspore/ccsrc/minddata/dataset/audio/ir/kernels/audio_ir.cc
  9. +26
    -0
      mindspore/ccsrc/minddata/dataset/audio/ir/kernels/audio_ir.h
  10. +6
    -0
      mindspore/ccsrc/minddata/dataset/audio/kernels/CMakeLists.txt
  11. +21
    -0
      mindspore/ccsrc/minddata/dataset/audio/kernels/spectrogram_op.cc
  12. +23
    -0
      mindspore/ccsrc/minddata/dataset/audio/kernels/spectrogram_op.h
  13. +27
    -0
      mindspore/ccsrc/minddata/dataset/include/audio.h
  14. +17
    -0
      mindspore/dataset/audio/__init__.py
  15. +16
    -0
      mindspore/dataset/audio/transforms.py

+ 5
- 0
mindspore/ccsrc/minddata/dataset/CMakeLists.txt View File

@@ -73,6 +73,7 @@ add_subdirectory(core)
add_subdirectory(kernels)
add_subdirectory(engine)
add_subdirectory(api)
add_subdirectory(audio)
add_subdirectory(text)
add_subdirectory(callback)
add_subdirectory(plugin)
@@ -91,6 +92,8 @@ add_dependencies(engine-perf core)
add_dependencies(engine-gnn core)
add_dependencies(engine core)
add_dependencies(callback core)
add_dependencies(audio-kernels core)
add_dependencies(audio-ir-kernels core)
add_dependencies(text core)
add_dependencies(text-kernels core)
add_dependencies(text-ir core)
@@ -151,6 +154,8 @@ set(submodules
$<TARGET_OBJECTS:engine-opt>
$<TARGET_OBJECTS:engine-cache-client>
$<TARGET_OBJECTS:engine>
$<TARGET_OBJECTS:audio-kernels>
$<TARGET_OBJECTS:audio-ir-kernels>
$<TARGET_OBJECTS:text>
$<TARGET_OBJECTS:text-kernels>
$<TARGET_OBJECTS:text-ir>


+ 2
- 0
mindspore/ccsrc/minddata/dataset/api/CMakeLists.txt View File

@@ -2,6 +2,7 @@ file(GLOB_RECURSE _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc"
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)
if(ENABLE_PYTHON)
add_library(APItoPython OBJECT
python/bindings/dataset/audio/kernels/ir/bindings.cc
python/bindings/dataset/callback/bindings.cc
python/bindings/dataset/core/bindings.cc
python/bindings/dataset/engine/cache/bindings.cc
@@ -27,6 +28,7 @@ if(ENABLE_PYTHON)
endif()

add_library(cpp-API OBJECT
audio.cc
config.cc
data_helper.cc
datasets.cc


+ 26
- 0
mindspore/ccsrc/minddata/dataset/api/audio.cc View File

@@ -0,0 +1,26 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "minddata/dataset/include/audio.h"

#include "minddata/dataset/audio/ir/kernels/audio_ir.h"

namespace mindspore {
namespace dataset {

namespace audio {} // namespace audio
} // namespace dataset
} // namespace mindspore

+ 24
- 0
mindspore/ccsrc/minddata/dataset/api/python/bindings/dataset/audio/kernels/ir/bindings.cc View File

@@ -0,0 +1,24 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "pybind11/pybind11.h"

#include "minddata/dataset/api/python/pybind_register.h"
#include "minddata/dataset/audio/ir/kernels/audio_ir.h"

namespace mindspore {
namespace dataset {} // namespace dataset
} // namespace mindspore

+ 5
- 0
mindspore/ccsrc/minddata/dataset/audio/CMakeLists.txt View File

@@ -0,0 +1,5 @@
add_subdirectory(ir)
add_subdirectory(kernels)

file(GLOB _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)

+ 4
- 0
mindspore/ccsrc/minddata/dataset/audio/ir/CMakeLists.txt View File

@@ -0,0 +1,4 @@
add_subdirectory(kernels)

file(GLOB_RECURSE _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)

+ 6
- 0
mindspore/ccsrc/minddata/dataset/audio/ir/kernels/CMakeLists.txt View File

@@ -0,0 +1,6 @@
file(GLOB_RECURSE _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)

add_library(audio-ir-kernels OBJECT
audio_ir.cc
)

+ 24
- 0
mindspore/ccsrc/minddata/dataset/audio/ir/kernels/audio_ir.cc View File

@@ -0,0 +1,24 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "minddata/dataset/audio/ir/kernels/audio_ir.h"

namespace mindspore {
namespace dataset {

namespace audio {} // namespace audio
} // namespace dataset
} // namespace mindspore

+ 26
- 0
mindspore/ccsrc/minddata/dataset/audio/ir/kernels/audio_ir.h View File

@@ -0,0 +1,26 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_AUDIO_IR_KERNELS_AUDIO_IR_H_
#define MINDSPORE_CCSRC_MINDDATA_DATASET_AUDIO_IR_KERNELS_AUDIO_IR_H_

namespace mindspore {
namespace dataset {

namespace audio {} // namespace audio
} // namespace dataset
} // namespace mindspore
#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_AUDIO_IR_KERNELS_AUDIO_IR_H_

+ 6
- 0
mindspore/ccsrc/minddata/dataset/audio/kernels/CMakeLists.txt View File

@@ -0,0 +1,6 @@
file(GLOB_RECURSE _CURRENT_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.cc")
set_property(SOURCE ${_CURRENT_SRC_FILES} PROPERTY COMPILE_DEFINITIONS SUBMODULE_ID=mindspore::SubModuleId::SM_MD)

add_library(audio-kernels OBJECT
spectrogram_op.cc
)

+ 21
- 0
mindspore/ccsrc/minddata/dataset/audio/kernels/spectrogram_op.cc View File

@@ -0,0 +1,21 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "minddata/dataset/audio/kernels/spectrogram_op.h"

namespace mindspore {
namespace dataset {} // namespace dataset
} // namespace mindspore

+ 23
- 0
mindspore/ccsrc/minddata/dataset/audio/kernels/spectrogram_op.h View File

@@ -0,0 +1,23 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_AUDIO_KERNELS_SPECTROGRAM_OP_H_
#define MINDSPORE_CCSRC_MINDDATA_DATASET_AUDIO_KERNELS_SPECTROGRAM_OP_H_

namespace mindspore {
namespace dataset {} // namespace dataset
} // namespace mindspore
#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_AUDIO_KERNELS_SPECTROGRAM_OP_H_

+ 27
- 0
mindspore/ccsrc/minddata/dataset/include/audio.h View File

@@ -0,0 +1,27 @@
/**
* Copyright 2021 Huawei Technologies Co., Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_AUDIO_H_
#define MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_AUDIO_H_

namespace mindspore {
namespace dataset {

namespace audio {} // namespace audio
} // namespace dataset
} // namespace mindspore

#endif // MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_AUDIO_H_

+ 17
- 0
mindspore/dataset/audio/__init__.py View File

@@ -0,0 +1,17 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This module is to support audio augmentations.
"""
from . import transforms

+ 16
- 0
mindspore/dataset/audio/transforms.py View File

@@ -0,0 +1,16 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
The module audio.transforms is inherited from _c_dataengine.
"""

Loading…
Cancel
Save