Skip to content

Getting files #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
miniJames opened this issue Dec 12, 2021 · 0 comments
Open

Getting files #7

miniJames opened this issue Dec 12, 2021 · 0 comments

Comments

@miniJames
Copy link

Maybe you can use the file system object and get files form a specified folder?

async function get_files(total){

const myFolder = 'testfolder';
let files = []
let count =0

fs.readdirSync(myFolder).forEach(file => {
    if(count <= total){
        file = testFolder +   file
        
        files.push(file)
    } else {
         
    }

    count ++
});
return files

}

Pass the list into the function that loads the images and loop through the array. Also resizing the image to fit your model specifications. I used 100*100 images. This way any image from any folder can be used as training data.

`
async function loadImages(files){
console.log("files",files)
const x_inputs = [];
let l=0
for(let file of files){
const img = await Jimp.read(file).then((img) => {
img.resize(100,100)
return img
})... ... ...

`
Try the number training dataset. I get some very cool results.

I have been fascinated with this for the last week, so I thought I would thank you and provide my feedback.

James.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant