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 OSX support #113

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,22 @@
./linux_mark.sh
```

* To compile on **Mac OSX** type in console 3 commands:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 4 commands.

```
brew install cmake
cmake .
make
./osx_mark.sh
```

Supported both: OpenCV 2.x and OpenCV 3.x

--------

1. To test, simply run
* **on Windows:** `x64/Release/yolo_mark.cmd`
* **on Linux:** `./linux_mark.sh`
* **on Mac OSX:** `./osx_mark.sh`

2. To use for labeling your custom images:

Expand Down
2 changes: 1 addition & 1 deletion linux_mark.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
echo Example how to start marking bouded boxes for training set Yolo v2
echo Example how to start marking bouded boxes for training set Yolo v3


./yolo_mark x64/Release/data/img x64/Release/data/train.txt x64/Release/data/obj.names
Expand Down
9 changes: 9 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ int main(int argc, char *argv[])
if (argc >= 4 && train_filename == "cap_video") {
const std::string videofile = synset_filename;
cv::VideoCapture cap(videofile);
#ifdef __APPLE__
const int fps = cap.get(CAP_PROP_FPS);
#elif
const int fps = cap.get(CV_CAP_PROP_FPS);
#endif
int frame_counter = 0, image_counter = 0;
float save_each_frames = 50;
if (argc >= 5) save_each_frames = std::stoul(std::string(argv[4]));
Expand Down Expand Up @@ -480,8 +484,13 @@ int main(int argc, char *argv[])

marks_changed = false;

#ifdef __APPLE__
rectangle(frame, prev_img_rect, Scalar(100, 100, 100), FILLED);
rectangle(frame, next_img_rect, Scalar(100, 100, 100), FILLED);
#elif
rectangle(frame, prev_img_rect, Scalar(100, 100, 100), CV_FILLED);
rectangle(frame, next_img_rect, Scalar(100, 100, 100), CV_FILLED);
#endif
}

trackbar_value = min(max(0, trackbar_value), (int)jpg_filenames_path.size() - 1);
Expand Down
4 changes: 4 additions & 0 deletions osx_mark.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
echo Example how to start marking bouded boxes for training set Yolo v3


./yolo_mark x64/Release/data/img x64/Release/data/train.txt x64/Release/data/obj.names