Skip to content
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

Added download/install instructions to README inorder to run Yolo_mark properly! (windows) #157

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
cba7924
reset head
alpizano Aug 31, 2019
5ad4b3b
ignoring imgs
alpizano Aug 31, 2019
fa89f4e
Update README.md
alpizano Sep 1, 2019
c638fa2
Update README.md
alpizano Sep 1, 2019
54fb123
Update README.md
alpizano Sep 1, 2019
02704ac
Update README.md
alpizano Sep 1, 2019
2a2e768
Update README.md
alpizano Sep 1, 2019
2d043aa
Update README.md
alpizano Sep 1, 2019
ad4178a
Update README.md
alpizano Sep 1, 2019
ea2dc4c
Update README.md
alpizano Sep 1, 2019
9454ae7
Update README.md
alpizano Sep 1, 2019
e0aa903
Update README.md
alpizano Sep 1, 2019
1b7b88f
Update README.md
alpizano Sep 1, 2019
4f6f8f1
Update README.md
alpizano Sep 1, 2019
0fb3524
Update README.md
alpizano Sep 1, 2019
9fdcfef
Update README.md
alpizano Sep 1, 2019
279dfdb
Update README.md
alpizano Sep 1, 2019
8970467
Update README.md
alpizano Sep 1, 2019
e3035d2
Update README.md
alpizano Sep 1, 2019
a735567
Update README.md
alpizano Sep 1, 2019
a3bb733
Update README.md
alpizano Sep 1, 2019
d2103c7
Update README.md
alpizano Sep 1, 2019
b10f754
Update README.md
alpizano Sep 1, 2019
e73c79b
Update README.md
alpizano Sep 1, 2019
04c1b55
Update README.md
alpizano Sep 1, 2019
c87be83
Update README.md
alpizano Sep 1, 2019
ff0f246
Update README.md
alpizano Sep 1, 2019
6de3a01
Update README.md
alpizano Sep 1, 2019
328cbf3
Update README.md
alpizano Sep 1, 2019
4b0d402
adding image for readme
alpizano Sep 1, 2019
ca60979
Update README.md
alpizano Sep 1, 2019
434184c
Update README.md
alpizano Sep 1, 2019
5a94d28
Update README.md
alpizano Sep 1, 2019
2db4fc5
Update README.md
alpizano Sep 1, 2019
13f1c5d
Update README.md
alpizano Sep 1, 2019
4b19bc3
Update README.md
alpizano Sep 1, 2019
e69dd5e
Update README.md
alpizano Sep 1, 2019
cbb0206
Update README.md
alpizano Sep 1, 2019
1250b0c
Update README.md
alpizano Sep 1, 2019
6e083b1
Update README.md
alpizano Sep 1, 2019
fda573c
Update README.md
alpizano Sep 1, 2019
90f91bf
Update README.md
alpizano Sep 1, 2019
25cb0fd
Update README.md
alpizano Sep 1, 2019
e55aab6
Update README.md
alpizano Sep 1, 2019
fdc500e
Update README.md
alpizano Sep 1, 2019
989bd77
Update README.md
alpizano Sep 1, 2019
52e2a07
added batch2 of transformed images and annotated them
alpizano Sep 16, 2019
368211a
trained new data set of 602 images for beating roulette
alpizano Oct 20, 2019
58d2341
added label_generator scripts and test_set_generator scripts for data…
alpizano Oct 22, 2019
e886015
changed shutil.copy to shutil.move for test set creation since test s…
alpizano Dec 5, 2019
e06cc56
added to git ignore
alpizano Dec 5, 2019
57ed823
Update yolo_mark.log
Dec 11, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
/CMakeFiles/
/Makefile
/cmake_install.cmake
/yolo_mark
/yolo_mark
.vs/
x64/Release/data
x64/Release/data/obj.names
x64/Release/data/*.txt
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/Yolo_mark.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

100 changes: 99 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,102 @@
# Yolo_mark
## Prerequisites (if you already have OpenCV for Windows and Visual Studio installed, you can jump to [Yolo_mark](#main) to begin)

You will need to download the following programs in order to use Yolo mark, if you do not already have them:

#### OpenCV (Download as a ZIP)

https://github.com/opencv/opencv

#### CMake

https://cmake.org/download/

#### Microsoft Visual Studio (2017 version 15.9.15 garaunteed to work)

https://visualstudio.microsoft.com/vs/older-downloads/

### Installation (For Windows 10 64-bit)

1. Extract the opencv-master.zip to your C: or any drive you like, and you can rename the outfolder so the directory is like this `C:/OpenCV4/opencv-master`

2. Open the CMake GUI

3. For the "Where is the source code:" field, click **Browse Source...** and add the directory of the OpenCV folder from above. In this example it is `C:/OpenCV4/opencv-master`.

4. For the "Where to build the binaries:" field, create a folder inside the OpenCV folder called "opencv" and click **Browse Build...** to add it. In this example, it is `C:/OpenCV4/opencv4`

5. Click **Configure**
- For "Specify the generator for this project", make sure to select your version of Visual Studio. In this example, we are using **Visual Studio 15 2017**
- Under "Optional platform for generator", select **x64**. If you leave it blank, it defaults to Win32 and you will only be able to build Debug/Release in Visual Studio in Win32 and may get `LNK1112 module machine type 'x64' conflicts with target machine type 'x86` build error.
- "Optional toolset to use" can be left blank.
- "Use default native compilers" can be checked.

6. After configuration is complete you will see a message `Configuring done` in the main GUI window. Find the field name **BUILD_opencv_world** in the main window and tick the box [x] to include it.

7. Click **Generate**
- You will see a message `Generating done` in the main GUI window when it is complete.

8. Click **Open Project**
- Visual Studio will open. You will need to find **CMakeTargets** folder in the Solution Explorer to the right. Make sure the Local Windows Debugger is set to **Debug** and **x64** and select the **ALL_BUILD** C++ project, right-click and select **BUILD**.
- If you happen to get an error:
`LNK1104: cannot open file 'python37_d.lib`
- Then you can build the debug version of that library yourself if you do not have the file anywhere on your computer. It's very simple, please refer to this Stack Overflow post where **J.T. Davies** explains how to do it:
https://stackoverflow.com/questions/17028576/using-python-3-3-in-c-python33-d-lib-not-found
- After, set the Local Windows Debugger to **Release** and keep it set to **x64**. Select the **ALL_BUILD** C++ project again, right-click and select **BUILD**.
- Keep the Local Windows Debugger on **Release** and set to **x64**. But this time, select the **INSTALL** C++ project, right-click and select **BUILD**.
- Change the Local Windows Debugger to **Debug** and set to **x64**. Select the **INSTALL** C++ project, right-click and select **BUILD**.
- This will generate all the library, includes, x64, and bin/lib directories all in one space.
- You can close out of Visual Studio.

9. In Windows search, type `env` to access the Environment Variables.
- In System Properties, under the Advanced tab, click **Environment Variables**
- Below the **System variables** list, click **New** and enter these values for the two fields:
- Variable name: `OPENCV_DIR`.
- Variable value: `C:\OpenCV4\opencv4\install\x64\vc15`
- Click OK
- Still in the **System variables** window, select **Path** and click **Edit**. Add these two directories to the path:
- %OPENCV_DIR%\bin
- %OPENCV_DIR%\lib
- Click OK and you can exit out of the System Properties now.

9. Test That Install Works
- Creating an empty C++ project (Name it anything you want)
- Right-click on the **Source Files** folder in the **Solution Explorer** to the right and add a **New Item** -> **C++ File (.cpp)** (sny name is fine)
- Copy and paste the code below into the Source.cpp you just added:
```
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"

using namespace std;
using namespace cv;

int main(int argv, char* argc)
{
Mat A;
A = Mat::zeros(100, 100, CV_8U);
namedWindow("x", WINDOW_AUTOSIZE);
imshow("x", A);
waitKey(0);
return 0;
}

- Click on **View** -> **Other Windows** -> **Property Manager**.
- A left sidebar will appear with **Debug | Win32**, **Debug | x64**, **Release | Win32**, and **Release | x64** options.
- **Make sure the Local Windows Debugger is set to Debug and x64**
- Right-click Debug | x64 in Property Manager window to the left and select **Properties**.
- *Alternatively*, you can find these same C/C++, Linker options by right-clicking your C++ project in the Solution Explorer and selecting **Properties**.
- Under **C/C++** -> **General** -> **Additional Include Directories**, add:
- `C:\OpenCV4\opencv4\install\include`or whatever your install\include location is
- Under **Linker** -> **Additional Library Dependences**, add:
- `C:\OpenCV4\opencv4\install\x64\vc15\lib`
- Under **Linker** -> **Input** -> **Additional Dependencies**, add:
- `opencv_highgui411d.lib`
- `opencv_core411d.lib`
- Note: If your other projects are requiring other library files, you may need to add them to the **Linker** -> **Input** -> **Additional Dependencies** field manually. These files will have a "d" suffix for debug and are found in `C:\OpenCV4\opencv4\install\x64\vc15\lib`

Press **CTRL + F5** or the green play button next to Windows Local Debugger and a blank image should be created and be shown on the screen signifing the installation went successfully! :bowtie:
![Installation Complete!](https://github.com/alpizano/Yolo_mark/blob/master/testopencv.png)

# Yolo_mark<a name="main"></a>
**Windows** & **Linux** GUI for marking bounded boxes of objects in images for training Yolo v3 and v2

* To compile on **Windows** open `yolo_mark.sln` in MSVS2013/2015, compile it **x64 & Release** and run the file: `x64/Release/yolo_mark.cmd`. Change paths in `yolo_mark.sln` to the OpenCV 2.x/3.x installed on your computer:
Expand Down
Binary file added testopencv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added x64/Debug/vc141.idb
Binary file not shown.
Binary file added x64/Debug/vc141.pdb
Binary file not shown.
2 changes: 2 additions & 0 deletions x64/Debug/yolo_mark.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
 main.cpp
c:\users\username\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(14): fatal error C1083: Cannot open include file: 'opencv2/opencv.hpp': No such file or directory
1 change: 1 addition & 0 deletions x64/Debug/yolo_mark.tlog/CL.command.1.tlog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��
Empty file.
2 changes: 2 additions & 0 deletions x64/Debug/yolo_mark.tlog/yolo_mark.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Debug|x64|C:\Users\XxaemaeThxX\Desktop\ML-NN-Chao-Sys\Yolo_mark\|
Binary file removed x64/Release/data/img/air1.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion x64/Release/data/img/air1.txt

This file was deleted.

Binary file removed x64/Release/data/img/air2.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion x64/Release/data/img/air2.txt

This file was deleted.

Binary file removed x64/Release/data/img/air3.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion x64/Release/data/img/air3.txt

This file was deleted.

Binary file removed x64/Release/data/img/air4.jpg
Binary file not shown.
9 changes: 0 additions & 9 deletions x64/Release/data/img/air4.txt

This file was deleted.

Binary file removed x64/Release/data/img/air5.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion x64/Release/data/img/air5.txt

This file was deleted.

Binary file removed x64/Release/data/img/air6.jpg
Binary file not shown.
15 changes: 0 additions & 15 deletions x64/Release/data/img/air6.txt

This file was deleted.

Binary file removed x64/Release/data/img/bird1.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion x64/Release/data/img/bird1.txt

This file was deleted.

Binary file removed x64/Release/data/img/bird2.jpg
Binary file not shown.
2 changes: 0 additions & 2 deletions x64/Release/data/img/bird2.txt

This file was deleted.

Binary file removed x64/Release/data/img/bird3.jpg
Binary file not shown.
3 changes: 0 additions & 3 deletions x64/Release/data/img/bird3.txt

This file was deleted.

Binary file removed x64/Release/data/img/bird4.jpg
Binary file not shown.
1 change: 0 additions & 1 deletion x64/Release/data/img/bird4.txt

This file was deleted.

5 changes: 3 additions & 2 deletions x64/Release/data/obj.names
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
air
bird
roulette ball
single zero
roulette wheel
12 changes: 1 addition & 11 deletions x64/Release/data/train.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1 @@
data/img/air1.jpg
data/img/air2.jpg
data/img/air3.jpg
data/img/air4.jpg
data/img/air5.jpg
data/img/air6.jpg
data/img/air7.jpg
data/img/bird1.jpg
data/img/bird2.jpg
data/img/bird3.jpg
data/img/bird4.jpg
data/img/037_frame640.jpg
13 changes: 13 additions & 0 deletions x64/Release/label_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import glob
import os

f = open("data/test.txt", "a+")
f2 = open("data/train.txt", "a+")

for files in glob.glob("data/test/*.jpg"):
#print(files)
f.write("%s\n" % files.strip().replace("test\\", "images/"))

for files in glob.glob("data/img/*.jpg"):
#print(files)
f2.write("%s\n" % files.strip().replace("\\", "/"))
Binary file added x64/Release/main.obj
Binary file not shown.
38 changes: 38 additions & 0 deletions x64/Release/test_set_generator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from glob import glob
import glob
import os
import numpy as np
import shutil

files = glob.glob('data/img/*.jpg')
print (files)

for i in range(0,len(files)):
print("index: %d is %s" % (i,files[i]))

no_of_images = len(files)
print(no_of_images)

#shuffle = np.random.permutation(no_of_images) # creates random permutation of 602 images
shuffle = np.random.permutation(no_of_images) # creates random permutation of 676

print(shuffle)

list = [1,3,5,9,7, 9,10]
#print(shuffle[:180])
#print(shuffle[180:])

os.mkdir(os.path.join('data', 'test')) # creates empty VALID folder

#for files in glob.glob('data/images/*.jpg'):
#print (files)

# %15 of 676
# need to move/seperate the valid images out of the imgs folder
for i in shuffle[:101]:
print(files[i])
shutil.move(files[i],'data/test')
folder = files[i].split('/')[-1].split('.')[0]
print(folder)
image = files[i].split('/')[-1]
print(image)
Binary file added x64/Release/vc141.pdb
Binary file not shown.
8 changes: 8 additions & 0 deletions x64/Release/yolo_mark.Build.CppClean.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\vc141.pdb
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\main.obj
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\yolo_mark.tlog\cl.command.1.tlog
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\yolo_mark.tlog\cl.read.1.tlog
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\yolo_mark.tlog\cl.write.1.tlog
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\yolo_mark.tlog\link.command.1.tlog
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\yolo_mark.tlog\link.read.1.tlog
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\x64\release\yolo_mark.tlog\link.write.1.tlog
Binary file added x64/Release/yolo_mark.exe
Binary file not shown.
Binary file added x64/Release/yolo_mark.iobj
Binary file not shown.
Binary file added x64/Release/yolo_mark.ipdb
Binary file not shown.
24 changes: 24 additions & 0 deletions x64/Release/yolo_mark.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
 main.cpp
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(144): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(145): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(151): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(295): warning C4244: 'initializing': conversion from 'double' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(295): warning C4244: 'initializing': conversion from 'double' to 'const int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(303): warning C4244: '=': conversion from 'unsigned long' to 'float', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(306): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(354): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(497): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(497): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(570): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(570): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(645): warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(645): warning C4267: 'initializing': conversion from 'size_t' to 'const int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(706): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(706): warning C4244: 'initializing': conversion from 'float' to 'const int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(707): warning C4244: 'initializing': conversion from 'float' to 'int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(707): warning C4244: 'initializing': conversion from 'float' to 'const int', possible loss of data
c:\users\xxaemaethxx\desktop\ml-nn-chao-sys\yolo_mark\main.cpp(814): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data
Generating code
All 1148 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
Finished generating code
yolo_mark.vcxproj -> C:\Users\XxaemaeThxX\Desktop\ML-NN-Chao-Sys\Yolo_mark\x64\Release\yolo_mark.exe
Binary file added x64/Release/yolo_mark.pdb
Binary file not shown.
Binary file added x64/Release/yolo_mark.tlog/CL.command.1.tlog
Binary file not shown.
Binary file added x64/Release/yolo_mark.tlog/CL.read.1.tlog
Binary file not shown.
Binary file added x64/Release/yolo_mark.tlog/CL.write.1.tlog
Binary file not shown.
Binary file added x64/Release/yolo_mark.tlog/link.command.1.tlog
Binary file not shown.
Binary file added x64/Release/yolo_mark.tlog/link.read.1.tlog
Binary file not shown.
Binary file added x64/Release/yolo_mark.tlog/link.write.1.tlog
Binary file not shown.
2 changes: 2 additions & 0 deletions x64/Release/yolo_mark.tlog/yolo_mark.lastbuildstate
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#TargetFrameworkVersion=v4.0:PlatformToolSet=v141:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=10.0.17763.0
Release|x64|C:\Users\XxaemaeThxX\Desktop\ML-NN-Chao-Sys\Yolo_mark\|
Binary file added x64/Release/yolo_mark.tlog/yolo_mark.write.1u.tlog
Binary file not shown.
Loading