hx173149 / C3D-tensorflow

C3D is a modified version of BVLC tensorflow to support 3D ConvNets.
MIT License
588 stars 265 forks source link

Issue with convert_images_to_list.sh #94

Open PBRAOS opened 5 years ago

PBRAOS commented 5 years ago

The files seems to split randomly the dataset, a 25-75 split normally should have representatives from each category. This is not the case. If for instance a category exists in one list it can be absent from another. Could be a jot versioning issue ?

PBRAOS commented 5 years ago

This should work better.

!/bin/bash

train.list test.list COUNT=-1 for folder in $1/ do echo $folder COUNT=$[$COUNT + 1] for imagesFolder in "$folder"/ do

    if ( (( ( RANDOM % $2 )  ))  > 1 ); then
        echo "$imagesFolder" $COUNT >> train.list
    else
        echo "$imagesFolder" $COUNT >> test.list
    fi        
done

done

highway007 commented 5 years ago

@PBRAOS Thx .This is work for me !

Yan-echo commented 5 years ago

Do you run it on Linux or Windows? How can I run it? I run it on Linux. There are some errors. I need your help. bash convert_images_to_list.sh /home/yan/yan1/tu 4 convert_images_to_list.sh: 行 2: $'\r': 未找到命令 convert_images_to_list.sh: 行 22: $'\r': 未找到命令 convert_images_to_list.sh: 行 27: 未预期的符号 `$'do\r'' 附近有语法错误

PBRAOS commented 5 years ago

Pm me

Pb

On 31 Mar 2019, at 10:29, Yan-echo notifications@github.com wrote:

Do you run it on Linux or Windows? How can I run it? I run it on Linux. There are some errors. I need your help. bash convert_images_to_list.sh /home/yan/yan1/tu 4 convert_images_to_list.sh: 行 2: $'\r': 未找到命令 convert_images_to_list.sh: 行 22: $'\r': 未找到命令 convert_images_to_list.sh: 行 27: 未预期的符号 `$'do\r'' 附近有语法错误

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

Yan-echo commented 5 years ago

This should work better.

!/bin/bash

train.list test.list COUNT=-1 for folder in $1/ do echo $folder COUNT=$[$COUNT + 1] for imagesFolder in "$folder"/ do

if ( (( ( RANDOM % $2 )  ))  > 1 ); then
    echo "$imagesFolder" $COUNT >> train.list
else
    echo "$imagesFolder" $COUNT >> test.list
fi        

done

done

This code can work, but it can't generate class, how should I do it?