Skip to content

Commit

Permalink
data prefecther issue
Browse files Browse the repository at this point in the history
out of memory
  • Loading branch information
yjyjy131 committed Jun 22, 2022
1 parent f8c6e98 commit 217e815
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@ Paper link: https://arxiv.org/abs/2003.11337
For vehicles equipped with the automatic parking system, the accuracy and speed of the parking slot detection are crucial. But the high accuracy is obtained at the price of low speed or expensive computation equipment, which are sensitive for many car manufacturers. In this paper, we proposed a detector using CNN(convolutional neural networks) for faster speed and smaller model size while keeps accuracy. To achieve the optimal balance, we developed a strategy to select the best receptive fields and prune the redundant channels automatically after each training epoch. The proposed model is capable of jointly detecting corners and line features of parking slots while running efficiently in real time on average processors. The model has a frame rate of about 30 FPS on a 2.3 GHz CPU core, yielding parking slot corner localization error of 1.51±2.14 cm (std. err.) and slot detection accuracy of 98%, generally satisfying the requirements in both speed and accuracy on onboard mobile terminals.

## Usage
Detailed instructions will be given soon.



1. 데이터 셋 구성
./data/train/
./data/train_raw_label/
./data/test/all/
./data/test/test_raw_label/










## Performance
The training and test data set is https://cslinzhang.github.io/deepps/
Expand Down
6 changes: 3 additions & 3 deletions SPFCN/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@ def setup(seed):
cudnn.deterministic = True


def slot_network_training(device_id=1):
def slot_network_training(device_id=0):
# Initial
setup(19960229)
net = SlotNetwork([32, 44, 64, 92, 128], device_id=device_id)

# Train
auto_train(get_training_set(6535, 50, 224, device_id), net, device_id=device_id,
auto_train(get_training_set(6535, 12, 224, device_id), net, device_id=device_id,
epoch_limit=1000, save_path="parameters/")


# TODO
def slot_network_testing(model_path, device_id=1):
def slot_network_testing(model_path, device_id=0):
# Initial
setup(19960229)

Expand Down
24 changes: 13 additions & 11 deletions SPFCN/dataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ def get_training_set(data_size: int,
assert 0 < data_size < 6596 and 0 < batch_size and 0 < resolution

vps_set = VisionParkingSlotDataset(
image_path="/data/training/",
label_path="/data/training_raw_label/",
image_path="./data/training/image/",
label_path="./data/training/label/",
data_size=data_size,
resolution=resolution)
if device_id < 0:
return DataLoader(dataset=vps_set, shuffle=True, batch_size=batch_size, num_workers=4)
else:
return DataPrefetcher(device=torch.device('cuda:%d' % device_id),
dataset=vps_set, batch_size=batch_size, shuffle=True)

return DataLoader(dataset=vps_set, shuffle=True, batch_size=batch_size, num_workers=4)
# if device_id < 0:
# return DataLoader(dataset=vps_set, shuffle=True, batch_size=batch_size, num_workers=4)
# else:
# return DataPrefetcher(device=torch.device('cuda:%d' % device_id),
# dataset=vps_set, batch_size=batch_size, shuffle=True)


def get_validating_set(data_size: int,
Expand All @@ -29,8 +31,8 @@ def get_validating_set(data_size: int,
device_id: int = 0):
assert 0 < data_size < 1538 and 0 < batch_size and 0 < resolution
vps_set = VisionParkingSlotDataset(
image_path="/data/testing/all/all/",
label_path="/data/testing/all/raw_label/",
image_path="./data/testing/image/",
label_path="./data/testing/label/",
data_size=data_size,
resolution=resolution)
if device_id < 0:
Expand All @@ -47,8 +49,8 @@ def get_testing_set(data_size: int,
device_id: int = 0):
assert 0 < data_size < 1538 and 0 < batch_size and 0 < resolution
vps_set = VisionParkingSlotDataset(
image_path="/data/testing/all/all/",
label_path="/data/testing/all/raw_label/",
image_path="./data/testing/image/",
label_path="./data/testing/label/",
data_size=data_size,
resolution=resolution)
if device_id < 0:
Expand Down

0 comments on commit 217e815

Please sign in to comment.